deno.land / std@0.224.0 / streams / to_text_test.ts

to_text_test.ts
نووسراو ببینە
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assertEquals } from "../assert/assert_equals.ts";import { toText } from "./to_text.ts";
Deno.test("toText()", async () => { const byteStream = ReadableStream.from(["hello", " js ", "fans"]) .pipeThrough(new TextEncoderStream());
assertEquals(await toText(byteStream), "hello js fans");
const stringStream = ReadableStream.from(["hello", " deno ", "world"]);
assertEquals(await toText(stringStream), "hello deno world");});
std

Version Info

Tagged at
3 weeks ago