diff options
Diffstat (limited to 'tests/unit/files_test.ts')
-rw-r--r-- | tests/unit/files_test.ts | 74 |
1 files changed, 32 insertions, 42 deletions
diff --git a/tests/unit/files_test.ts b/tests/unit/files_test.ts index 71c5a4561..754c6fb15 100644 --- a/tests/unit/files_test.ts +++ b/tests/unit/files_test.ts @@ -7,7 +7,6 @@ import { assertEquals, assertRejects, assertThrows, - DENO_FUTURE, } from "./test_util.ts"; import { copy } from "@std/io/copy"; @@ -19,37 +18,31 @@ Deno.test(function filesStdioFileDescriptors() { assertEquals(Deno.stderr.rid, 2); }); -Deno.test( - { ignore: DENO_FUTURE, permissions: { read: true } }, - async function filesCopyToStdout() { - const filename = "tests/testdata/assets/fixture.json"; - using file = await Deno.open(filename); - assert(file instanceof Deno.File); - assert(file instanceof Deno.FsFile); - assert(file.rid > 2); - const bytesWritten = await copy(file, Deno.stdout); - const fileSize = Deno.statSync(filename).size; - assertEquals(bytesWritten, fileSize); - }, -); +Deno.test({ permissions: { read: true } }, async function filesCopyToStdout() { + const filename = "tests/testdata/assets/fixture.json"; + using file = await Deno.open(filename); + assert(file instanceof Deno.File); + assert(file instanceof Deno.FsFile); + assert(file.rid > 2); + const bytesWritten = await copy(file, Deno.stdout); + const fileSize = Deno.statSync(filename).size; + assertEquals(bytesWritten, fileSize); +}); -Deno.test( - { ignore: DENO_FUTURE, permissions: { read: true } }, - async function filesIter() { - const filename = "tests/testdata/assets/hello.txt"; - using file = await Deno.open(filename); +Deno.test({ permissions: { read: true } }, async function filesIter() { + const filename = "tests/testdata/assets/hello.txt"; + using file = await Deno.open(filename); - let totalSize = 0; - for await (const buf of Deno.iter(file)) { - totalSize += buf.byteLength; - } + let totalSize = 0; + for await (const buf of Deno.iter(file)) { + totalSize += buf.byteLength; + } - assertEquals(totalSize, 12); - }, -); + assertEquals(totalSize, 12); +}); Deno.test( - { ignore: DENO_FUTURE, permissions: { read: true } }, + { permissions: { read: true } }, async function filesIterCustomBufSize() { const filename = "tests/testdata/assets/hello.txt"; using file = await Deno.open(filename); @@ -66,23 +59,20 @@ Deno.test( }, ); -Deno.test( - { ignore: DENO_FUTURE, permissions: { read: true } }, - function filesIterSync() { - const filename = "tests/testdata/assets/hello.txt"; - using file = Deno.openSync(filename); +Deno.test({ permissions: { read: true } }, function filesIterSync() { + const filename = "tests/testdata/assets/hello.txt"; + using file = Deno.openSync(filename); - let totalSize = 0; - for (const buf of Deno.iterSync(file)) { - totalSize += buf.byteLength; - } + let totalSize = 0; + for (const buf of Deno.iterSync(file)) { + totalSize += buf.byteLength; + } - assertEquals(totalSize, 12); - }, -); + assertEquals(totalSize, 12); +}); Deno.test( - { ignore: DENO_FUTURE, permissions: { read: true } }, + { permissions: { read: true } }, function filesIterSyncCustomBufSize() { const filename = "tests/testdata/assets/hello.txt"; using file = Deno.openSync(filename); @@ -99,7 +89,7 @@ Deno.test( }, ); -Deno.test({ ignore: DENO_FUTURE }, async function readerIter() { +Deno.test(async function readerIter() { // ref: https://github.com/denoland/deno/issues/2330 const encoder = new TextEncoder(); @@ -134,7 +124,7 @@ Deno.test({ ignore: DENO_FUTURE }, async function readerIter() { assertEquals(totalSize, 12); }); -Deno.test({ ignore: DENO_FUTURE }, async function readerIterSync() { +Deno.test(async function readerIterSync() { // ref: https://github.com/denoland/deno/issues/2330 const encoder = new TextEncoder(); |