From 78c8491a7efddcb56f9ffe0fb2d4df727b68ae39 Mon Sep 17 00:00:00 2001 From: Peter Marshall Date: Thu, 22 Nov 2018 10:16:29 +0100 Subject: [PATCH] test: remove apply calls over 65534 arg limit PR-URL: https://github.com/nodejs/node/pull/25852 Reviewed-By: Ujjwal Sharma Reviewed-By: Matteo Collina Reviewed-By: Ali Ijaz Sheikh --- test/parallel/test-buffer-includes.js | 5 +++-- test/parallel/test-buffer-indexof.js | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/test/parallel/test-buffer-includes.js b/test/parallel/test-buffer-includes.js index 2a163f9e0c628e..605f988de5c648 100644 --- a/test/parallel/test-buffer-includes.js +++ b/test/parallel/test-buffer-includes.js @@ -214,8 +214,9 @@ assert(asciiString.includes('leb', 0)); // Search in string containing many non-ASCII chars. const allCodePoints = []; -for (let i = 0; i < 65536; i++) allCodePoints[i] = i; -const allCharsString = String.fromCharCode.apply(String, allCodePoints); +for (let i = 0; i < 65534; i++) allCodePoints[i] = i; +const allCharsString = String.fromCharCode.apply(String, allCodePoints) + + String.fromCharCode(65534, 65535); const allCharsBufferUtf8 = Buffer.from(allCharsString); const allCharsBufferUcs2 = Buffer.from(allCharsString, 'ucs2'); diff --git a/test/parallel/test-buffer-indexof.js b/test/parallel/test-buffer-indexof.js index cba6af44e5b02d..44353c127602d8 100644 --- a/test/parallel/test-buffer-indexof.js +++ b/test/parallel/test-buffer-indexof.js @@ -276,8 +276,9 @@ assert.strictEqual(asciiString.indexOf('leb', 0), 3); // Search in string containing many non-ASCII chars. const allCodePoints = []; -for (let i = 0; i < 65536; i++) allCodePoints[i] = i; -const allCharsString = String.fromCharCode.apply(String, allCodePoints); +for (let i = 0; i < 65534; i++) allCodePoints[i] = i; +const allCharsString = String.fromCharCode.apply(String, allCodePoints) + + String.fromCharCode(65534, 65535); const allCharsBufferUtf8 = Buffer.from(allCharsString); const allCharsBufferUcs2 = Buffer.from(allCharsString, 'ucs2');