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 targos committed Aug 8, 2021
1 parent f21f717 commit 3b25cbe
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 @@ -107,14 +107,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 3b25cbe

Please sign in to comment.