Skip to content

Commit 93befdf

Browse files
committed
fixup
1 parent 0003f43 commit 93befdf

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

test/parallel/test-buffer-tostring-range.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
require('../common');
3+
const common = require('../common');
44
const assert = require('assert');
55

66
const rangeBuffer = Buffer.from('abc');
@@ -99,7 +99,10 @@ assert.throws(() => {
9999
message: 'Unknown encoding: null'
100100
});
101101

102-
103-
const largeBuffer = Buffer.alloc(2 ** 32);
104102
// Must not throw when start and end are within kMaxLength
105-
largeBuffer.toString('utf8', 2 ** 31 + 1, 2 ** 31 + 10);
103+
// Cannot test on 32bit machine as we are testing the case
104+
// when start and end are above the threshold
105+
common.skipIf32Bits();
106+
const threshold = 0xFFFFFFFF;
107+
const largeBuffer = Buffer.alloc(threshold + 20);
108+
largeBuffer.toString('utf8', threshold, threshold + 20);

0 commit comments

Comments
 (0)