diff options
author | sigmaSd <bedisnbiba@gmail.com> | 2023-10-22 09:02:55 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-22 08:02:55 +0000 |
commit | 9f9c3d9048108200a888c508328d2a19cbbd6164 (patch) | |
tree | 664847bcef81d34a26d5371378d460b61245eac3 /cli/tests/unit_node/_fs/_fs_open_test.ts | |
parent | fb73eb1e9dca3e93cc7efcf5c2244e0068733843 (diff) |
fix(polyfill): correctly handle flag when its equal 0 (#20953)
Fixes https://github.com/denoland/deno/issues/20910
Diffstat (limited to 'cli/tests/unit_node/_fs/_fs_open_test.ts')
-rw-r--r-- | cli/tests/unit_node/_fs/_fs_open_test.ts | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cli/tests/unit_node/_fs/_fs_open_test.ts b/cli/tests/unit_node/_fs/_fs_open_test.ts index b64e6c4c5..d9f5e5796 100644 --- a/cli/tests/unit_node/_fs/_fs_open_test.ts +++ b/cli/tests/unit_node/_fs/_fs_open_test.ts @@ -397,4 +397,14 @@ Deno.test("[std/node/fs] open callback isn't called twice if error is thrown", a await Deno.remove(tempFile); }, }); + + Deno.test({ + name: "SYNC: open file with flag set to 0 (readonly)", + fn() { + const file = Deno.makeTempFileSync(); + const fd = openSync(file, 0); + assert(Deno.resources()[fd]); + closeSync(fd); + }, + }); }); |