From 7a0a7bb23f6406189bc79561dd27e24211f3d475 Mon Sep 17 00:00:00 2001 From: Oscar <71343264+0scvr@users.noreply.github.com> Date: Thu, 26 Oct 2023 11:44:34 +0200 Subject: [PATCH] chore: remove `readableStreamFromReader()` & `StringReader()` in CSV stream test (#3725) To fix deprecation warnings Signed-off-by: Oscar <71343264+0scvr@users.noreply.github.com> --- csv/csv_parse_stream_test.ts | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/csv/csv_parse_stream_test.ts b/csv/csv_parse_stream_test.ts index 0060da4da8d3..774a59596a85 100644 --- a/csv/csv_parse_stream_test.ts +++ b/csv/csv_parse_stream_test.ts @@ -2,7 +2,6 @@ import { CsvParseStream } from "./csv_parse_stream.ts"; import type { CsvParseStreamOptions } from "./csv_parse_stream.ts"; import { ERR_QUOTE, ParseError } from "./_io.ts"; -import { readableStreamFromReader } from "../streams/readable_stream_from_reader.ts"; import { assert, assertEquals, @@ -11,7 +10,6 @@ import { } from "../assert/mod.ts"; import type { AssertTrue, IsExact } from "../testing/types.ts"; import { fromFileUrl, join } from "../path/mod.ts"; -import { StringReader } from "../io/string_reader.ts"; import { delay } from "../async/delay.ts"; const testdataDir = join(fromFileUrl(import.meta.url), "../testdata"); @@ -331,7 +329,7 @@ x,,, if (testCase.columns) { options.columns = testCase.columns; } - const readable = createReadableStreamFromString(testCase.input) + const readable = ReadableStream.from(testCase.input) .pipeThrough(new CsvParseStream(options)); if (testCase.output) { @@ -350,12 +348,6 @@ x,,, }, }); -function createReadableStreamFromString(s: string): ReadableStream { - return readableStreamFromReader(new StringReader(s)).pipeThrough( - new TextDecoderStream(), - ); -} - // Work around resource leak error with TextDecoderStream: // https://github.com/denoland/deno/issues/13142 export const MyTextDecoderStream = () => {