diff options
| author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2022-04-27 07:03:44 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-04-27 16:03:44 +0200 |
| commit | 8b8b21b553fba03124934363e77e636adaeb4745 (patch) | |
| tree | dc21d5b6df8dbbd9f38980e00d76dcfec5921863 /cli | |
| parent | 9853c96cc4686a6cd1ffa1e9081c012b8df72ff7 (diff) | |
perf(runtime): read entire files in single ops (#14261)
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
Diffstat (limited to 'cli')
| -rw-r--r-- | cli/tests/unit/read_file_test.ts | 40 |
1 files changed, 0 insertions, 40 deletions
diff --git a/cli/tests/unit/read_file_test.ts b/cli/tests/unit/read_file_test.ts index 1f3eea30a..07935b7fb 100644 --- a/cli/tests/unit/read_file_test.ts +++ b/cli/tests/unit/read_file_test.ts @@ -1,5 +1,4 @@ // Copyright 2018-2022 the Deno authors. All rights reserved. MIT license. -import { writeAllSync } from "../../../test_util/std/io/util.ts"; import { assert, assertEquals, @@ -152,42 +151,3 @@ Deno.test( assert(data.byteLength > 0); }, ); - -Deno.test( - { permissions: { read: true, write: true } }, - async function readFileExtendedDuringRead() { - // Write 128MB file - const filename = Deno.makeTempDirSync() + "/test.txt"; - const data = new Uint8Array(1024 * 1024 * 128); - Deno.writeFileSync(filename, data); - const promise = Deno.readFile(filename); - queueMicrotask(() => { - // Append 128MB to file - const f = Deno.openSync(filename, { append: true }); - writeAllSync(f, data); - f.close(); - }); - const read = await promise; - assertEquals(read.byteLength, data.byteLength * 2); - }, -); - -Deno.test( - { permissions: { read: true, write: true } }, - async function readFile0LengthExtendedDuringRead() { - // Write 0 byte file - const filename = Deno.makeTempDirSync() + "/test.txt"; - const first = new Uint8Array(0); - const second = new Uint8Array(1024 * 1024 * 128); - Deno.writeFileSync(filename, first); - const promise = Deno.readFile(filename); - queueMicrotask(() => { - // Append 128MB to file - const f = Deno.openSync(filename, { append: true }); - writeAllSync(f, second); - f.close(); - }); - const read = await promise; - assertEquals(read.byteLength, second.byteLength); - }, -); |
