Skip to content

Commit

Permalink
test: check mustCall errors in test-fs-read-type
Browse files Browse the repository at this point in the history
PR-URL: #36914
Refs: #36190
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Antoine du Hamel <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
  • Loading branch information
tniessen authored and ruyadorno committed Jan 21, 2021
1 parent 30b2aac commit c2ec15a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/parallel/test-fs-read-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,18 @@ fs.read(fd,
0,
expected.length,
0n,
common.mustCall());
common.mustSucceed());

fs.read(fd,
Buffer.allocUnsafe(expected.length),
0,
expected.length,
2n ** 53n - 1n,
common.mustCall());
common.mustCall((err) => {
if (err) {
assert.strictEqual(err.code, 'EFBIG');
}
}));

assert.throws(
() => fs.readSync(fd, expected.length, 0, 'utf-8'),
Expand Down

0 comments on commit c2ec15a

Please sign in to comment.