deno.land / std@0.224.0 / io / write_all_test.ts

write_all_test.ts
View Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
import { assert, assertEquals } from "../assert/mod.ts";import { writeAll, writeAllSync } from "./write_all.ts";import { Buffer } from "./buffer.ts";import { init } from "./_test_common.ts";
Deno.test("writeAll()", async () => { const testBytes = init(); assert(testBytes); const writer = new Buffer(); await writeAll(writer, testBytes); const actualBytes = writer.bytes(); assertEquals(testBytes, actualBytes);});
Deno.test("writeAllSync()", () => { const testBytes = init(); assert(testBytes); const writer = new Buffer(); writeAllSync(writer, testBytes); const actualBytes = writer.bytes(); assertEquals(testBytes, actualBytes);});
std

Version Info

Tagged at
6 months ago