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: nodejs#36914
Refs: nodejs#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 foxxyz committed Oct 18, 2021
1 parent 5ae8e01 commit 982fd37
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 982fd37

Please sign in to comment.