summaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
authorAndy Hayden <andyhayden1@gmail.com>2019-01-17 10:08:59 -0800
committerRyan Dahl <ry@tinyclouds.org>2019-01-17 13:08:59 -0500
commitb2e54bad61b37f3a186dd72237c694ada77ab94f (patch)
treebc30bea78e49fe9c854be93e0509aabc76f77392 /io
parent811128864c4db40409c5c5538b56466e4f4e704c (diff)
Remove race-condition in file_server tests (denoland/deno_std#125)
Original: https://github.com/denoland/deno_std/commit/e28c9a407951f10d952993ff6a7b248ca11243e1
Diffstat (limited to 'io')
-rw-r--r--io/bufio.ts3
-rw-r--r--io/util.ts6
2 files changed, 2 insertions, 7 deletions
diff --git a/io/bufio.ts b/io/bufio.ts
index 0dd2b94b4..05e6b0a0c 100644
--- a/io/bufio.ts
+++ b/io/bufio.ts
@@ -4,7 +4,8 @@
// license that can be found in the LICENSE file.
import { Reader, ReadResult, Writer } from "deno";
-import { assert, charCode, copyBytes } from "./util.ts";
+import { charCode, copyBytes } from "./util.ts";
+import { assert } from "../testing/mod.ts";
const DEFAULT_BUF_SIZE = 4096;
const MIN_BUF_SIZE = 16;
diff --git a/io/util.ts b/io/util.ts
index 811940b4d..3266e5018 100644
--- a/io/util.ts
+++ b/io/util.ts
@@ -1,11 +1,5 @@
import { Buffer, Reader } from "deno";
-export function assert(cond: boolean, msg = "assert") {
- if (!cond) {
- throw Error(msg);
- }
-}
-
// `off` is the offset into `dst` where it will at which to begin writing values
// from `src`.
// Returns the number of bytes copied.