From 5db3f257ab88b37e7df8bd9704755ce61d40ebdd Mon Sep 17 00:00:00 2001 From: rickyes Date: Thu, 7 May 2020 18:42:38 +0800 Subject: [PATCH] fixup --- test/parallel/test-file-write-stream3.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/parallel/test-file-write-stream3.js b/test/parallel/test-file-write-stream3.js index 5ee28d16a660dd..b68fdbf3a1fbfc 100644 --- a/test/parallel/test-file-write-stream3.js +++ b/test/parallel/test-file-write-stream3.js @@ -182,10 +182,12 @@ const run_test_4 = common.mustCall(function() { const fn = () => { fs.createWriteStream(filepath, { start: -5, flags: 'r+' }); }; + // Verify the range of values using a common integer verifier. + // Limit Number.MAX_SAFE_INTEGER const err = { code: 'ERR_OUT_OF_RANGE', message: 'The value of "start" is out of range. ' + - 'It must be >= 0 && <= 9007199254740991. Received -5', + `It must be >= 0 && <= ${Number.MAX_SAFE_INTEGER}. Received -5`, name: 'RangeError' }; assert.throws(fn, err); @@ -197,10 +199,13 @@ const run_test_5 = common.mustCall(function() { const fn = () => { fs.createWriteStream(filepath, { start: 2 ** 53, flags: 'r+' }); }; + // Verify the range of values using a common integer verifier. + // Limit Number.MAX_SAFE_INTEGER const err = { code: 'ERR_OUT_OF_RANGE', message: 'The value of "start" is out of range. It must be ' + - '>= 0 && <= 9007199254740991. Received 9_007_199_254_740_992', + `>= 0 && <= ${Number.MAX_SAFE_INTEGER}. ` + + 'Received 9_007_199_254_740_992', name: 'RangeError' }; assert.throws(fn, err);