summaryrefslogtreecommitdiff
path: root/cli/tests/unit/stat_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/unit/stat_test.ts')
-rw-r--r--cli/tests/unit/stat_test.ts8
1 files changed, 2 insertions, 6 deletions
diff --git a/cli/tests/unit/stat_test.ts b/cli/tests/unit/stat_test.ts
index cbc5909b5..ccb17b164 100644
--- a/cli/tests/unit/stat_test.ts
+++ b/cli/tests/unit/stat_test.ts
@@ -8,7 +8,7 @@ import {
} from "./test_util.ts";
Deno.test({ permissions: { read: true } }, function fstatSyncSuccess() {
- const file = Deno.openSync("README.md");
+ using file = Deno.openSync("README.md");
const fileInfo = Deno.fstatSync(file.rid);
assert(fileInfo.isFile);
assert(!fileInfo.isSymlink);
@@ -18,12 +18,10 @@ Deno.test({ permissions: { read: true } }, function fstatSyncSuccess() {
assert(fileInfo.mtime);
// The `birthtime` field is not available on Linux before kernel version 4.11.
assert(fileInfo.birthtime || Deno.build.os === "linux");
-
- Deno.close(file.rid);
});
Deno.test({ permissions: { read: true } }, async function fstatSuccess() {
- const file = await Deno.open("README.md");
+ using file = await Deno.open("README.md");
const fileInfo = await Deno.fstat(file.rid);
assert(fileInfo.isFile);
assert(!fileInfo.isSymlink);
@@ -33,8 +31,6 @@ Deno.test({ permissions: { read: true } }, async function fstatSuccess() {
assert(fileInfo.mtime);
// The `birthtime` field is not available on Linux before kernel version 4.11.
assert(fileInfo.birthtime || Deno.build.os === "linux");
-
- Deno.close(file.rid);
});
Deno.test(