summaryrefslogtreecommitdiff
path: root/cli/tests/unit/copy_file_test.ts
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2024-02-01 10:06:09 +0530
committerGitHub <noreply@github.com>2024-02-01 10:06:09 +0530
commit4f914dd1617bb2aa3a5a3f5a4b8dec9356e851c1 (patch)
tree0b90e662044abe1396ce1d3690d8e793d9cb8c3d /cli/tests/unit/copy_file_test.ts
parente58b1900a7b018a36deff22fdd34f4676180a4bb (diff)
fix(fs): copyFile NUL path on macOS (#22216)
Fixes https://github.com/denoland/deno/issues/22211
Diffstat (limited to 'cli/tests/unit/copy_file_test.ts')
-rw-r--r--cli/tests/unit/copy_file_test.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/tests/unit/copy_file_test.ts b/cli/tests/unit/copy_file_test.ts
index 1c967b043..ad467f510 100644
--- a/cli/tests/unit/copy_file_test.ts
+++ b/cli/tests/unit/copy_file_test.ts
@@ -236,3 +236,14 @@ Deno.test(
copyFileSyncMode("Hello world!".repeat(128 * 1024));
},
);
+
+Deno.test(
+ { permissions: { read: true, write: true } },
+ async function copyFileNulPath() {
+ const fromFilename = "from.txt\0";
+ const toFilename = "to.txt\0";
+ await assertRejects(async () => {
+ await Deno.copyFile(fromFilename, toFilename);
+ }, TypeError);
+ },
+);