summaryrefslogtreecommitdiff
path: root/cli/tests/056_make_temp_file_write_perm.ts
diff options
context:
space:
mode:
Diffstat (limited to 'cli/tests/056_make_temp_file_write_perm.ts')
-rw-r--r--cli/tests/056_make_temp_file_write_perm.ts13
1 files changed, 7 insertions, 6 deletions
diff --git a/cli/tests/056_make_temp_file_write_perm.ts b/cli/tests/056_make_temp_file_write_perm.ts
index 15aefaff9..c0deda8a2 100644
--- a/cli/tests/056_make_temp_file_write_perm.ts
+++ b/cli/tests/056_make_temp_file_write_perm.ts
@@ -1,8 +1,9 @@
-const path = await Deno.makeTempFile({ dir: "./subdir/" });
-if (path.startsWith(Deno.cwd())) {
+const path = await Deno.makeTempFile({ dir: `subdir` });
+try {
+ if (!path.match(/^subdir[/\\][^/\\]+/)) {
+ throw Error("bad " + path);
+ }
console.log("good", path);
-} else {
- throw Error("bad " + path);
+} finally {
+ await Deno.remove(path);
}
-console.log(path);
-await Deno.remove(path);