summaryrefslogtreecommitdiff
path: root/cli/js/files_test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/js/files_test.ts')
-rw-r--r--cli/js/files_test.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/cli/js/files_test.ts b/cli/js/files_test.ts
index de0d3019a..7e3479798 100644
--- a/cli/js/files_test.ts
+++ b/cli/js/files_test.ts
@@ -21,6 +21,7 @@ testPerm({ read: true }, async function filesCopyToStdout(): Promise<void> {
const fileSize = Deno.statSync(filename).len;
assertEquals(bytesWritten, fileSize);
console.log("bytes written", bytesWritten);
+ file.close();
});
testPerm({ read: true }, async function filesToAsyncIterator(): Promise<void> {
@@ -33,6 +34,7 @@ testPerm({ read: true }, async function filesToAsyncIterator(): Promise<void> {
}
assertEquals(totalSize, 12);
+ file.close();
});
test(async function readerToAsyncIterator(): Promise<void> {
@@ -308,6 +310,7 @@ testPerm({ read: true }, async function seekStart(): Promise<void> {
await file.read(buf);
const decoded = new TextDecoder().decode(buf);
assertEquals(decoded, "world!");
+ file.close();
});
testPerm({ read: true }, function seekSyncStart(): void {
@@ -321,6 +324,7 @@ testPerm({ read: true }, function seekSyncStart(): void {
file.readSync(buf);
const decoded = new TextDecoder().decode(buf);
assertEquals(decoded, "world!");
+ file.close();
});
testPerm({ read: true }, async function seekCurrent(): Promise<void> {
@@ -334,6 +338,7 @@ testPerm({ read: true }, async function seekCurrent(): Promise<void> {
await file.read(buf);
const decoded = new TextDecoder().decode(buf);
assertEquals(decoded, "world!");
+ file.close();
});
testPerm({ read: true }, function seekSyncCurrent(): void {
@@ -347,6 +352,7 @@ testPerm({ read: true }, function seekSyncCurrent(): void {
file.readSync(buf);
const decoded = new TextDecoder().decode(buf);
assertEquals(decoded, "world!");
+ file.close();
});
testPerm({ read: true }, async function seekEnd(): Promise<void> {
@@ -357,6 +363,7 @@ testPerm({ read: true }, async function seekEnd(): Promise<void> {
await file.read(buf);
const decoded = new TextDecoder().decode(buf);
assertEquals(decoded, "world!");
+ file.close();
});
testPerm({ read: true }, function seekSyncEnd(): void {
@@ -367,6 +374,7 @@ testPerm({ read: true }, function seekSyncEnd(): void {
file.readSync(buf);
const decoded = new TextDecoder().decode(buf);
assertEquals(decoded, "world!");
+ file.close();
});
testPerm({ read: true }, async function seekMode(): Promise<void> {
@@ -387,4 +395,5 @@ testPerm({ read: true }, async function seekMode(): Promise<void> {
const buf = new Uint8Array(1);
await file.read(buf); // "H"
assertEquals(new TextDecoder().decode(buf), "H");
+ file.close();
});