summaryrefslogtreecommitdiff
path: root/std/io/ioutil_test.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2020-02-11 17:24:27 +0100
committerGitHub <noreply@github.com>2020-02-11 17:24:27 +0100
commit61273085e40fb4d992eef4b1b5601e3567c80664 (patch)
tree1ac0f401d4cb897bdb6f88e3a5c47fece2856f89 /std/io/ioutil_test.ts
parente0bcecee6042b219c6626172851af5a25362b948 (diff)
refactor: rewrite tests in std/ to use Deno.test (#3930)
Diffstat (limited to 'std/io/ioutil_test.ts')
-rw-r--r--std/io/ioutil_test.ts17
1 files changed, 8 insertions, 9 deletions
diff --git a/std/io/ioutil_test.ts b/std/io/ioutil_test.ts
index 26f307a6b..261f4def0 100644
--- a/std/io/ioutil_test.ts
+++ b/std/io/ioutil_test.ts
@@ -1,7 +1,6 @@
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
const { Buffer } = Deno;
type Reader = Deno.Reader;
-import { test } from "../testing/mod.ts";
import { assertEquals } from "../testing/asserts.ts";
import {
copyN,
@@ -25,19 +24,19 @@ class BinaryReader implements Reader {
}
}
-test(async function testReadShort(): Promise<void> {
+Deno.test(async function testReadShort(): Promise<void> {
const r = new BinaryReader(new Uint8Array([0x12, 0x34]));
const short = await readShort(new BufReader(r));
assertEquals(short, 0x1234);
});
-test(async function testReadInt(): Promise<void> {
+Deno.test(async function testReadInt(): Promise<void> {
const r = new BinaryReader(new Uint8Array([0x12, 0x34, 0x56, 0x78]));
const int = await readInt(new BufReader(r));
assertEquals(int, 0x12345678);
});
-test(async function testReadLong(): Promise<void> {
+Deno.test(async function testReadLong(): Promise<void> {
const r = new BinaryReader(
new Uint8Array([0x00, 0x00, 0x00, 0x78, 0x12, 0x34, 0x56, 0x78])
);
@@ -45,7 +44,7 @@ test(async function testReadLong(): Promise<void> {
assertEquals(long, 0x7812345678);
});
-test(async function testReadLong2(): Promise<void> {
+Deno.test(async function testReadLong2(): Promise<void> {
const r = new BinaryReader(
new Uint8Array([0, 0, 0, 0, 0x12, 0x34, 0x56, 0x78])
);
@@ -53,7 +52,7 @@ test(async function testReadLong2(): Promise<void> {
assertEquals(long, 0x12345678);
});
-test(async function testSliceLongToBytes(): Promise<void> {
+Deno.test(async function testSliceLongToBytes(): Promise<void> {
const arr = sliceLongToBytes(0x1234567890abcdef);
const actual = readLong(new BufReader(new BinaryReader(new Uint8Array(arr))));
const expected = readLong(
@@ -66,12 +65,12 @@ test(async function testSliceLongToBytes(): Promise<void> {
assertEquals(actual, expected);
});
-test(async function testSliceLongToBytes2(): Promise<void> {
+Deno.test(async function testSliceLongToBytes2(): Promise<void> {
const arr = sliceLongToBytes(0x12345678);
assertEquals(arr, [0, 0, 0, 0, 0x12, 0x34, 0x56, 0x78]);
});
-test(async function testCopyN1(): Promise<void> {
+Deno.test(async function testCopyN1(): Promise<void> {
const w = new Buffer();
const r = stringsReader("abcdefghij");
const n = await copyN(w, r, 3);
@@ -79,7 +78,7 @@ test(async function testCopyN1(): Promise<void> {
assertEquals(w.toString(), "abc");
});
-test(async function testCopyN2(): Promise<void> {
+Deno.test(async function testCopyN2(): Promise<void> {
const w = new Buffer();
const r = stringsReader("abcdefghij");
const n = await copyN(w, r, 11);