Skip to content

Commit

Permalink
fs: add test for zero-length read
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
fracsinus and aduh95 committed Nov 23, 2021
1 parent 8fdb45b commit 3d49687
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/parallel/test-fs-promises-file-handle-read.js
Expand Up @@ -87,8 +87,7 @@ async function validateReadWithPositionZero() {
}
}

async function validateReadLength() {
const len = 1;
async function validateReadLength(len) {
const buf = Buffer.alloc(4);
const opts = { useConf: true };
const filePath = fixtures.path('x.txt');
Expand All @@ -108,5 +107,6 @@ async function validateReadLength() {
await validateLargeRead({ useConf: true });
await validateReadNoParams();
await validateReadWithPositionZero();
await validateReadLength();
await validateReadLength(0);
await validateReadLength(1);
})().then(common.mustCall());

0 comments on commit 3d49687

Please sign in to comment.