summaryrefslogtreecommitdiff
path: root/cli/tests/unit_node/_fs/_fs_read_test.ts
diff options
context:
space:
mode:
authorsigmaSd <bedisnbiba@gmail.com>2023-10-22 09:02:55 +0100
committerGitHub <noreply@github.com>2023-10-22 08:02:55 +0000
commit9f9c3d9048108200a888c508328d2a19cbbd6164 (patch)
tree664847bcef81d34a26d5371378d460b61245eac3 /cli/tests/unit_node/_fs/_fs_read_test.ts
parentfb73eb1e9dca3e93cc7efcf5c2244e0068733843 (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_read_test.ts')
-rw-r--r--cli/tests/unit_node/_fs/_fs_read_test.ts15
1 files changed, 15 insertions, 0 deletions
diff --git a/cli/tests/unit_node/_fs/_fs_read_test.ts b/cli/tests/unit_node/_fs/_fs_read_test.ts
index 66906ccbc..34b029d9f 100644
--- a/cli/tests/unit_node/_fs/_fs_read_test.ts
+++ b/cli/tests/unit_node/_fs/_fs_read_test.ts
@@ -306,3 +306,18 @@ Deno.test({
await Deno.remove(file);
},
});
+
+Deno.test({
+ name: "SYNC: read with no offsetOropts argument",
+ fn() {
+ const moduleDir = path.dirname(path.fromFileUrl(import.meta.url));
+ const testData = path.resolve(moduleDir, "testdata", "hello.txt");
+ const buffer = Buffer.alloc(1024);
+ const fd = openSync(testData, "r");
+ const _bytesRead = readSync(
+ fd,
+ buffer,
+ );
+ closeSync(fd);
+ },
+});