File tree 1 file changed +7
-2
lines changed
1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -182,10 +182,12 @@ const run_test_4 = common.mustCall(function() {
182
182
const fn = ( ) => {
183
183
fs . createWriteStream ( filepath , { start : - 5 , flags : 'r+' } ) ;
184
184
} ;
185
+ // Verify the range of values using a common integer verifier.
186
+ // Limit Number.MAX_SAFE_INTEGER
185
187
const err = {
186
188
code : 'ERR_OUT_OF_RANGE' ,
187
189
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` ,
189
191
name : 'RangeError'
190
192
} ;
191
193
assert . throws ( fn , err ) ;
@@ -197,10 +199,13 @@ const run_test_5 = common.mustCall(function() {
197
199
const fn = ( ) => {
198
200
fs . createWriteStream ( filepath , { start : 2 ** 53 , flags : 'r+' } ) ;
199
201
} ;
202
+ // Verify the range of values using a common integer verifier.
203
+ // Limit Number.MAX_SAFE_INTEGER
200
204
const err = {
201
205
code : 'ERR_OUT_OF_RANGE' ,
202
206
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' ,
204
209
name : 'RangeError'
205
210
} ;
206
211
assert . throws ( fn , err ) ;
You can’t perform that action at this time.
0 commit comments