diff options
Diffstat (limited to 'bufio_test.ts')
| -rw-r--r-- | bufio_test.ts | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/bufio_test.ts b/bufio_test.ts index 80068f2d3..9c89f0216 100644 --- a/bufio_test.ts +++ b/bufio_test.ts @@ -1,4 +1,4 @@ -// Ported to Deno from: +// Based on https://github.com/golang/go/blob/891682/src/bufio/bufio_test.go // Copyright 2009 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. @@ -10,7 +10,7 @@ import { assertEqual } from "https://deno.land/x/testing/testing.ts"; import { BufReader, BufState } from "./bufio.ts"; -import { Buffer } from "./buffer.ts"; +import { Buffer, stringsReader } from "./buffer.ts"; import * as iotest from "./iotest.ts"; import { charCode, copyBytes } from "./util.ts"; @@ -31,11 +31,6 @@ async function readBytes(buf: BufReader): Promise<string> { return decoder.decode(b.subarray(0, nb)); } -function stringsReader(s: string): Reader { - const ui8 = encoder.encode(s); - return new Buffer(ui8.buffer as ArrayBuffer); -} - test(async function bufioReaderSimple() { const data = "hello world"; const b = new BufReader(stringsReader(data)); |
