Skip to content

Commit 78c8491

Browse files
psmarshalltargos
authored andcommitted
test: remove apply calls over 65534 arg limit
PR-URL: #25852 Reviewed-By: Ujjwal Sharma <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ali Ijaz Sheikh <[email protected]>
1 parent e0b3de1 commit 78c8491

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

test/parallel/test-buffer-includes.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,9 @@ assert(asciiString.includes('leb', 0));
214214

215215
// Search in string containing many non-ASCII chars.
216216
const allCodePoints = [];
217-
for (let i = 0; i < 65536; i++) allCodePoints[i] = i;
218-
const allCharsString = String.fromCharCode.apply(String, allCodePoints);
217+
for (let i = 0; i < 65534; i++) allCodePoints[i] = i;
218+
const allCharsString = String.fromCharCode.apply(String, allCodePoints) +
219+
String.fromCharCode(65534, 65535);
219220
const allCharsBufferUtf8 = Buffer.from(allCharsString);
220221
const allCharsBufferUcs2 = Buffer.from(allCharsString, 'ucs2');
221222

test/parallel/test-buffer-indexof.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,9 @@ assert.strictEqual(asciiString.indexOf('leb', 0), 3);
276276

277277
// Search in string containing many non-ASCII chars.
278278
const allCodePoints = [];
279-
for (let i = 0; i < 65536; i++) allCodePoints[i] = i;
280-
const allCharsString = String.fromCharCode.apply(String, allCodePoints);
279+
for (let i = 0; i < 65534; i++) allCodePoints[i] = i;
280+
const allCharsString = String.fromCharCode.apply(String, allCodePoints) +
281+
String.fromCharCode(65534, 65535);
281282
const allCharsBufferUtf8 = Buffer.from(allCharsString);
282283
const allCharsBufferUcs2 = Buffer.from(allCharsString, 'ucs2');
283284

0 commit comments

Comments
 (0)