Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup! buffer,error: improve bigint, big numbers and more
  • Loading branch information
BridgeAR committed Apr 15, 2019
commit 1987eeb2c76a30595a5d170fd915656a28f16ebb
4 changes: 3 additions & 1 deletion test/parallel/test-buffer-writeint.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ const errorOutOfBounds = common.expectsError({
range = `>= -(2 ** ${i * 8 - 1}) and < 2 ** ${i * 8 - 1}`;
}
[min - 1, max + 1].forEach((val) => {
const received = i > 4 ? val.toLocaleString() : val;
const received = i > 4 ?
String(val).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') :
val;
assert.throws(() => {
data[fn](val, 0, i);
}, {
Expand Down
4 changes: 3 additions & 1 deletion test/parallel/test-buffer-writeuint.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,9 @@ const assert = require('assert');
// Test 1 to 6 bytes.
for (let i = 1; i < 6; i++) {
const range = i < 5 ? `= ${val - 1}` : ` 2 ** ${i * 8}`;
const received = i > 4 ? val.toLocaleString() : val;
const received = i > 4 ?
String(val).replace(/(\d)(?=(\d\d\d)+(?!\d))/g, '$1,') :
val;
['writeUIntBE', 'writeUIntLE'].forEach((fn) => {
assert.throws(() => {
data[fn](val, 0, i);
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-crypto-pbkdf2.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ assert.throws(
}, {
code: 'ERR_OUT_OF_RANGE',
name: 'RangeError',
message: 'The value of "keylen" is out of range. It must be ' +
`>= 0 && < 4294967296. Received ${input.toLocaleString()}`
message: 'The value of "keylen" is out of range. It must be >= 0 && < ' +
`4294967296. Received ${input === -1 ? '-1' : '4,294,967,297'}`
});
});

Expand Down