summaryrefslogtreecommitdiff
path: root/std/io/bufio_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'std/io/bufio_test.ts')
-rw-r--r--std/io/bufio_test.ts39
1 files changed, 21 insertions, 18 deletions
diff --git a/std/io/bufio_test.ts b/std/io/bufio_test.ts
index d3e39bff6..671ed2115 100644
--- a/std/io/bufio_test.ts
+++ b/std/io/bufio_test.ts
@@ -447,21 +447,24 @@ Deno.test("readStringDelimAndLines", async function (): Promise<void> {
assertEquals(lines_, ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"]);
});
-Deno.test(async function bufReaderShouldNotShareArrayBufferAcrossReads() {
- const decoder = new TextDecoder();
- const data = "abcdefghijklmnopqrstuvwxyz";
- const bufSize = 25;
- const b = new BufReader(stringsReader(data), bufSize);
-
- const r1 = (await b.readLine()) as ReadLineResult;
- assertNotEOF(r1);
- assertEquals(decoder.decode(r1.line), "abcdefghijklmnopqrstuvwxy");
-
- const r2 = (await b.readLine()) as ReadLineResult;
- assertNotEOF(r2);
- assertEquals(decoder.decode(r2.line), "z");
- assert(
- r1.line.buffer !== r2.line.buffer,
- "array buffer should not be shared across reads"
- );
-});
+Deno.test(
+ "bufReaderShouldNotShareArrayBufferAcrossReads",
+ async function (): Promise<void> {
+ const decoder = new TextDecoder();
+ const data = "abcdefghijklmnopqrstuvwxyz";
+ const bufSize = 25;
+ const b = new BufReader(stringsReader(data), bufSize);
+
+ const r1 = (await b.readLine()) as ReadLineResult;
+ assert(r1 !== null);
+ assertEquals(decoder.decode(r1.line), "abcdefghijklmnopqrstuvwxy");
+
+ const r2 = (await b.readLine()) as ReadLineResult;
+ assert(r2 !== null);
+ assertEquals(decoder.decode(r2.line), "z");
+ assert(
+ r1.line.buffer !== r2.line.buffer,
+ "array buffer should not be shared across reads"
+ );
+ }
+);