Skip to content

Commit

Permalink
chore: remove readableStreamFromReader() & StringReader() in CSV …
Browse files Browse the repository at this point in the history
…stream test (#3725)

To fix deprecation warnings

Signed-off-by: Oscar <[email protected]>
  • Loading branch information
0scvr authored Oct 26, 2023
1 parent f64ea09 commit 7a0a7bb
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions csv/csv_parse_stream_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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");
Expand Down Expand Up @@ -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) {
Expand All @@ -350,12 +348,6 @@ x,,,
},
});

function createReadableStreamFromString(s: string): ReadableStream<string> {
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 = () => {
Expand Down

0 comments on commit 7a0a7bb

Please sign in to comment.