From 6d7e3621daad936c87de930e8b9537e5ccc913e3 Mon Sep 17 00:00:00 2001 From: uki00a Date: Thu, 21 May 2020 01:15:41 +0900 Subject: [PATCH] fix: compilation error introduced by #4543 (#5673) --- std/io/bufio_test.ts | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/std/io/bufio_test.ts b/std/io/bufio_test.ts index d3e39bff67..671ed2115e 100644 --- a/std/io/bufio_test.ts +++ b/std/io/bufio_test.ts @@ -447,21 +447,24 @@ Deno.test("readStringDelimAndLines", async function (): Promise { 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); +Deno.test( + "bufReaderShouldNotShareArrayBufferAcrossReads", + async function (): Promise { + 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 r1 = (await b.readLine()) as ReadLineResult; + assert(r1 !== null); + 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" - ); -}); + 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" + ); + } +);