summaryrefslogtreecommitdiff
path: root/io/readers_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'io/readers_test.ts')
-rw-r--r--io/readers_test.ts25
1 files changed, 13 insertions, 12 deletions
diff --git a/io/readers_test.ts b/io/readers_test.ts
index 8da9d6e73..17410804f 100644
--- a/io/readers_test.ts
+++ b/io/readers_test.ts
@@ -1,5 +1,6 @@
const { copy } = Deno;
-import { assert, test } from "../testing/mod.ts";
+import { test } from "../testing/mod.ts";
+import { assertEq } from "../testing/asserts.ts";
import { MultiReader, StringReader } from "./readers.ts";
import { StringWriter } from "./writers.ts";
import { copyN } from "./ioutil.ts";
@@ -8,29 +9,29 @@ import { decode } from "../strings/strings.ts";
test(async function ioStringReader() {
const r = new StringReader("abcdef");
const { nread, eof } = await r.read(new Uint8Array(6));
- assert.equal(nread, 6);
- assert.equal(eof, true);
+ assertEq(nread, 6);
+ assertEq(eof, true);
});
test(async function ioStringReader() {
const r = new StringReader("abcdef");
const buf = new Uint8Array(3);
let res1 = await r.read(buf);
- assert.equal(res1.nread, 3);
- assert.equal(res1.eof, false);
- assert.equal(decode(buf), "abc");
+ assertEq(res1.nread, 3);
+ assertEq(res1.eof, false);
+ assertEq(decode(buf), "abc");
let res2 = await r.read(buf);
- assert.equal(res2.nread, 3);
- assert.equal(res2.eof, true);
- assert.equal(decode(buf), "def");
+ assertEq(res2.nread, 3);
+ assertEq(res2.eof, true);
+ assertEq(decode(buf), "def");
});
test(async function ioMultiReader() {
const r = new MultiReader(new StringReader("abc"), new StringReader("def"));
const w = new StringWriter();
const n = await copyN(w, r, 4);
- assert.equal(n, 4);
- assert.equal(w.toString(), "abcd");
+ assertEq(n, 4);
+ assertEq(w.toString(), "abcd");
await copy(w, r);
- assert.equal(w.toString(), "abcdef");
+ assertEq(w.toString(), "abcdef");
});