diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-02-11 17:24:27 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 17:24:27 +0100 |
commit | 61273085e40fb4d992eef4b1b5601e3567c80664 (patch) | |
tree | 1ac0f401d4cb897bdb6f88e3a5c47fece2856f89 /std/io/bufio_test.ts | |
parent | e0bcecee6042b219c6626172851af5a25362b948 (diff) |
refactor: rewrite tests in std/ to use Deno.test (#3930)
Diffstat (limited to 'std/io/bufio_test.ts')
-rw-r--r-- | std/io/bufio_test.ts | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/std/io/bufio_test.ts b/std/io/bufio_test.ts index 780dfd3db..665c25361 100644 --- a/std/io/bufio_test.ts +++ b/std/io/bufio_test.ts @@ -5,7 +5,6 @@ const { Buffer } = Deno; type Reader = Deno.Reader; -import { test, runIfMain } from "../testing/mod.ts"; import { assert, assertEquals, @@ -43,7 +42,7 @@ async function readBytes(buf: BufReader): Promise<string> { return decoder.decode(b.subarray(0, nb)); } -test(async function bufioReaderSimple(): Promise<void> { +Deno.test(async function bufioReaderSimple(): Promise<void> { const data = "hello world"; const b = new BufReader(stringsReader(data)); const s = await readBytes(b); @@ -111,7 +110,7 @@ const bufsizes: number[] = [ 4096 ]; -test(async function bufioBufReader(): Promise<void> { +Deno.test(async function bufioBufReader(): Promise<void> { const texts = new Array<string>(31); let str = ""; let all = ""; @@ -139,7 +138,7 @@ test(async function bufioBufReader(): Promise<void> { } }); -test(async function bufioBufferFull(): Promise<void> { +Deno.test(async function bufioBufferFull(): Promise<void> { const longString = "And now, hello, world! It is the time for all good men to come to the" + " aid of their party"; @@ -160,7 +159,7 @@ test(async function bufioBufferFull(): Promise<void> { assertEquals(actual, "world!"); }); -test(async function bufioReadString(): Promise<void> { +Deno.test(async function bufioReadString(): Promise<void> { const string = "And now, hello world!"; const buf = new BufReader(stringsReader(string), MIN_READ_BUFFER_SIZE); @@ -242,12 +241,12 @@ async function testReadLine(input: Uint8Array): Promise<void> { } } -test(async function bufioReadLine(): Promise<void> { +Deno.test(async function bufioReadLine(): Promise<void> { await testReadLine(testInput); await testReadLine(testInputrn); }); -test(async function bufioPeek(): Promise<void> { +Deno.test(async function bufioPeek(): Promise<void> { const decoder = new TextDecoder(); const p = new Uint8Array(10); // string is 16 (minReadBufferSize) long. @@ -323,7 +322,7 @@ test(async function bufioPeek(): Promise<void> { */ }); -test(async function bufioWriter(): Promise<void> { +Deno.test(async function bufioWriter(): Promise<void> { const data = new Uint8Array(8192); for (let i = 0; i < data.byteLength; i++) { @@ -357,7 +356,7 @@ test(async function bufioWriter(): Promise<void> { } }); -test(async function bufReaderReadFull(): Promise<void> { +Deno.test(async function bufReaderReadFull(): Promise<void> { const enc = new TextEncoder(); const dec = new TextDecoder(); const text = "Hello World"; @@ -382,5 +381,3 @@ test(async function bufReaderReadFull(): Promise<void> { } } }); - -runIfMain(import.meta); |