From b2e54bad61b37f3a186dd72237c694ada77ab94f Mon Sep 17 00:00:00 2001 From: Andy Hayden Date: Thu, 17 Jan 2019 10:08:59 -0800 Subject: Remove race-condition in file_server tests (denoland/deno_std#125) Original: https://github.com/denoland/deno_std/commit/e28c9a407951f10d952993ff6a7b248ca11243e1 --- io/bufio.ts | 3 ++- io/util.ts | 6 ------ 2 files changed, 2 insertions(+), 7 deletions(-) (limited to 'io') 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. -- cgit v1.2.3