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 <cjihrig@gmail.com>
Reviewed-By: Richard Lau <rlau@redhat.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
tniessen authored and MylesBorins committed Aug 31, 2021
1 parent 2459c11 commit f3be3ec
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 f3be3ec

Please sign in to comment.