Skip to content

Commit

Permalink
test: use error code mapping in place of raw errno
Browse files Browse the repository at this point in the history
  • Loading branch information
RaisinTen committed Aug 7, 2021
1 parent 822f9ff commit 046c8ab
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/parallel/test-fs-read-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ fs.read(fd,
common.mustCall((err) => {
if (err) {
if (common.isIBMi)
assert.strictEqual(err.errno, -127);
assert.strictEqual(err.code, 'EOVERFLOW');
else
assert.strictEqual(err.code, 'EFBIG');
}
Expand Down Expand Up @@ -238,6 +238,6 @@ try {
// On systems where max file size is below 2^53-1, we'd expect a EFBIG error.
// This is not using `assert.throws` because the above call should not raise
// any error on systems that allows file of that size.
if (err.code !== 'EFBIG' && !(common.isIBMi && err.errno === -127))
if (err.code !== 'EFBIG' && !(common.isIBMi && err.code === 'EOVERFLOW'))
throw err;
}

0 comments on commit 046c8ab

Please sign in to comment.