summaryrefslogtreecommitdiff
path: root/tests/unit/io_test.ts
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2024-08-16 00:30:06 +0100
committerGitHub <noreply@github.com>2024-08-15 23:30:06 +0000
commitb6c74aab240430fa70c057be825ce766d2314e02 (patch)
tree6e2b3f690411f41de77972339f4145d2c85b31b8 /tests/unit/io_test.ts
parenta58494483a2c618636697e05f9c799b03e405056 (diff)
Revert "test: run unit tests with DENO_FUTURE=1 (#24400)" (#25060)
This reverts commit 22a834ff5b4b312b8f91be8991f2b495d49fad2f. Appears this commit might have broken tests on `main`.
Diffstat (limited to 'tests/unit/io_test.ts')
-rw-r--r--tests/unit/io_test.ts41
1 files changed, 19 insertions, 22 deletions
diff --git a/tests/unit/io_test.ts b/tests/unit/io_test.ts
index 44a04698c..5b55729dd 100644
--- a/tests/unit/io_test.ts
+++ b/tests/unit/io_test.ts
@@ -1,5 +1,5 @@
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
-import { assertEquals, DENO_FUTURE } from "./test_util.ts";
+import { assertEquals } from "./test_util.ts";
import { Buffer } from "@std/io/buffer";
const DEFAULT_BUF_SIZE = 32 * 1024;
@@ -28,7 +28,7 @@ function spyRead(obj: Buffer): Spy {
return spy;
}
-Deno.test({ ignore: DENO_FUTURE }, async function copyWithDefaultBufferSize() {
+Deno.test(async function copyWithDefaultBufferSize() {
const xBytes = repeat("b", DEFAULT_BUF_SIZE);
const reader = new Buffer(xBytes.buffer as ArrayBuffer);
const write = new Buffer();
@@ -43,7 +43,7 @@ Deno.test({ ignore: DENO_FUTURE }, async function copyWithDefaultBufferSize() {
assertEquals(readSpy.calls, 2); // read with DEFAULT_BUF_SIZE bytes + read with 0 bytes
});
-Deno.test({ ignore: DENO_FUTURE }, async function copyWithCustomBufferSize() {
+Deno.test(async function copyWithCustomBufferSize() {
const bufSize = 1024;
const xBytes = repeat("b", DEFAULT_BUF_SIZE);
const reader = new Buffer(xBytes.buffer as ArrayBuffer);
@@ -59,22 +59,19 @@ Deno.test({ ignore: DENO_FUTURE }, async function copyWithCustomBufferSize() {
assertEquals(readSpy.calls, DEFAULT_BUF_SIZE / bufSize + 1);
});
-Deno.test(
- { ignore: DENO_FUTURE, permissions: { write: true } },
- async function copyBufferToFile() {
- const filePath = "test-file.txt";
- // bigger than max File possible buffer 16kb
- const bufSize = 32 * 1024;
- const xBytes = repeat("b", bufSize);
- const reader = new Buffer(xBytes.buffer as ArrayBuffer);
- const write = await Deno.open(filePath, { write: true, create: true });
-
- // deno-lint-ignore no-deprecated-deno-api
- const n = await Deno.copy(reader, write, { bufSize });
-
- assertEquals(n, xBytes.length);
-
- write.close();
- await Deno.remove(filePath);
- },
-);
+Deno.test({ permissions: { write: true } }, async function copyBufferToFile() {
+ const filePath = "test-file.txt";
+ // bigger than max File possible buffer 16kb
+ const bufSize = 32 * 1024;
+ const xBytes = repeat("b", bufSize);
+ const reader = new Buffer(xBytes.buffer as ArrayBuffer);
+ const write = await Deno.open(filePath, { write: true, create: true });
+
+ // deno-lint-ignore no-deprecated-deno-api
+ const n = await Deno.copy(reader, write, { bufSize });
+
+ assertEquals(n, xBytes.length);
+
+ write.close();
+ await Deno.remove(filePath);
+});