From 1a2f88609b3e1bc27790c77331ac96b423625eb6 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Sat, 6 Jun 2020 10:37:52 -0400 Subject: fix(std/io): StringReader implementation (#6148) --- std/examples/tests/xeval_test.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'std/examples') diff --git a/std/examples/tests/xeval_test.ts b/std/examples/tests/xeval_test.ts index 3db1459a9..f86e27866 100644 --- a/std/examples/tests/xeval_test.ts +++ b/std/examples/tests/xeval_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { xeval } from "../xeval.ts"; -import { stringsReader } from "../../io/util.ts"; +import { StringReader } from "../../io/readers.ts"; import { decode, encode } from "../../encoding/utf8.ts"; import { assertEquals, @@ -11,15 +11,19 @@ const { execPath, run } = Deno; Deno.test("xevalSuccess", async function (): Promise { const chunks: string[] = []; - await xeval(stringsReader("a\nb\nc"), ($): number => chunks.push($)); + await xeval(new StringReader("a\nb\nc"), ($): number => chunks.push($)); assertEquals(chunks, ["a", "b", "c"]); }); Deno.test("xevalDelimiter", async function (): Promise { const chunks: string[] = []; - await xeval(stringsReader("!MADMADAMADAM!"), ($): number => chunks.push($), { - delimiter: "MADAM", - }); + await xeval( + new StringReader("!MADMADAMADAM!"), + ($): number => chunks.push($), + { + delimiter: "MADAM", + } + ); assertEquals(chunks, ["!MAD", "ADAM!"]); }); -- cgit v1.2.3