From ff9df0c321eb56c7f89f5ccdaa301453f22f708e Mon Sep 17 00:00:00 2001 From: Robert Jack Will Date: Mon, 28 Oct 2019 18:28:29 +0100 Subject: std: fix BufReader.readString to actually return Deno.EOF at end (#3191) --- std/io/bufio_test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'std/io/bufio_test.ts') diff --git a/std/io/bufio_test.ts b/std/io/bufio_test.ts index 75664694a..780dfd3db 100644 --- a/std/io/bufio_test.ts +++ b/std/io/bufio_test.ts @@ -161,13 +161,18 @@ test(async function bufioBufferFull(): Promise { }); test(async function bufioReadString(): Promise { - const string = "And now, hello, world!"; + const string = "And now, hello world!"; const buf = new BufReader(stringsReader(string), MIN_READ_BUFFER_SIZE); const line = assertNotEOF(await buf.readString(",")); assertEquals(line, "And now,"); assertEquals(line.length, 8); + const line2 = assertNotEOF(await buf.readString(",")); + assertEquals(line2, " hello world!"); + + assertEquals(await buf.readString(","), Deno.EOF); + try { await buf.readString("deno"); -- cgit v1.2.3