Skip to content

Commit 5db3f25

Browse files
committed
fixup
1 parent 9250a5c commit 5db3f25

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

test/parallel/test-file-write-stream3.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,12 @@ const run_test_4 = common.mustCall(function() {
182182
const fn = () => {
183183
fs.createWriteStream(filepath, { start: -5, flags: 'r+' });
184184
};
185+
// Verify the range of values using a common integer verifier.
186+
// Limit Number.MAX_SAFE_INTEGER
185187
const err = {
186188
code: 'ERR_OUT_OF_RANGE',
187189
message: 'The value of "start" is out of range. ' +
188-
'It must be >= 0 && <= 9007199254740991. Received -5',
190+
`It must be >= 0 && <= ${Number.MAX_SAFE_INTEGER}. Received -5`,
189191
name: 'RangeError'
190192
};
191193
assert.throws(fn, err);
@@ -197,10 +199,13 @@ const run_test_5 = common.mustCall(function() {
197199
const fn = () => {
198200
fs.createWriteStream(filepath, { start: 2 ** 53, flags: 'r+' });
199201
};
202+
// Verify the range of values using a common integer verifier.
203+
// Limit Number.MAX_SAFE_INTEGER
200204
const err = {
201205
code: 'ERR_OUT_OF_RANGE',
202206
message: 'The value of "start" is out of range. It must be ' +
203-
'>= 0 && <= 9007199254740991. Received 9_007_199_254_740_992',
207+
`>= 0 && <= ${Number.MAX_SAFE_INTEGER}. ` +
208+
'Received 9_007_199_254_740_992',
204209
name: 'RangeError'
205210
};
206211
assert.throws(fn, err);

0 commit comments

Comments
 (0)