Skip to content

Commit 3d49687

Browse files
fracsinusaduh95
andcommitted
fs: add test for zero-length read
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
1 parent 8fdb45b commit 3d49687

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/parallel/test-fs-promises-file-handle-read.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,7 @@ async function validateReadWithPositionZero() {
8787
}
8888
}
8989

90-
async function validateReadLength() {
91-
const len = 1;
90+
async function validateReadLength(len) {
9291
const buf = Buffer.alloc(4);
9392
const opts = { useConf: true };
9493
const filePath = fixtures.path('x.txt');
@@ -108,5 +107,6 @@ async function validateReadLength() {
108107
await validateLargeRead({ useConf: true });
109108
await validateReadNoParams();
110109
await validateReadWithPositionZero();
111-
await validateReadLength();
110+
await validateReadLength(0);
111+
await validateReadLength(1);
112112
})().then(common.mustCall());

0 commit comments

Comments
 (0)