summaryrefslogtreecommitdiff
path: root/cli/tests/unit/truncate_test.ts
diff options
context:
space:
mode:
authorAsher Gomez <ashersaupingomez@gmail.com>2024-01-25 01:59:55 +1100
committerGitHub <noreply@github.com>2024-01-24 15:59:55 +0100
commit62786cfebb5c9fe36d0930582951f442bdfe9441 (patch)
treea1bede5492a5b1bf4a202ee8994df027f098e788 /cli/tests/unit/truncate_test.ts
parent4af121687cb4c26f4a2f3e4ad266490d8faa3d2d (diff)
feat: deprecate `Deno.close()` (#22066)
For removal in Deno v2. --------- Co-authored-by: Bartek IwaƄczuk <biwanczuk@gmail.com>
Diffstat (limited to 'cli/tests/unit/truncate_test.ts')
-rw-r--r--cli/tests/unit/truncate_test.ts6
1 files changed, 2 insertions, 4 deletions
diff --git a/cli/tests/unit/truncate_test.ts b/cli/tests/unit/truncate_test.ts
index 97d4db62d..95b76052d 100644
--- a/cli/tests/unit/truncate_test.ts
+++ b/cli/tests/unit/truncate_test.ts
@@ -5,7 +5,7 @@ Deno.test(
{ permissions: { read: true, write: true } },
function ftruncateSyncSuccess() {
const filename = Deno.makeTempDirSync() + "/test_ftruncateSync.txt";
- const file = Deno.openSync(filename, {
+ using file = Deno.openSync(filename, {
create: true,
read: true,
write: true,
@@ -18,7 +18,6 @@ Deno.test(
file.truncateSync(-5);
assertEquals(Deno.readFileSync(filename).byteLength, 0);
- Deno.close(file.rid);
Deno.removeSync(filename);
},
);
@@ -27,7 +26,7 @@ Deno.test(
{ permissions: { read: true, write: true } },
async function ftruncateSuccess() {
const filename = Deno.makeTempDirSync() + "/test_ftruncate.txt";
- const file = await Deno.open(filename, {
+ using file = await Deno.open(filename, {
create: true,
read: true,
write: true,
@@ -40,7 +39,6 @@ Deno.test(
await file.truncate(-5);
assertEquals((await Deno.readFile(filename)).byteLength, 0);
- Deno.close(file.rid);
await Deno.remove(filename);
},
);