From 5a9d7b3bf5e2ec90246c305b8c4a449a4f0d05f2 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Fri, 16 Jun 2017 03:07:07 +0300 Subject: [PATCH] test: use string instead of RegExp in split() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/13710 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Gibson Fahnestock Reviewed-By: Michaƫl Zasso --- .../test-http-outgoing-first-chunk-singlebyte-encoding.js | 2 +- test/parallel/test-repl-setprompt.js | 2 +- test/parallel/test-stdin-script-child.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/parallel/test-http-outgoing-first-chunk-singlebyte-encoding.js b/test/parallel/test-http-outgoing-first-chunk-singlebyte-encoding.js index f1af1dc718bd9a..7249230cfadbb7 100644 --- a/test/parallel/test-http-outgoing-first-chunk-singlebyte-encoding.js +++ b/test/parallel/test-http-outgoing-first-chunk-singlebyte-encoding.js @@ -24,7 +24,7 @@ for (const enc of ['utf8', 'utf16le', 'latin1', 'UTF-8']) { const headerEnd = received.indexOf('\r\n\r\n', 'utf8'); assert.notStrictEqual(headerEnd, -1); - const header = received.toString('utf8', 0, headerEnd).split(/\r\n/); + const header = received.toString('utf8', 0, headerEnd).split('\r\n'); const body = received.toString(enc, headerEnd + 4); assert.strictEqual(header[0], 'HTTP/1.1 200 OK'); diff --git a/test/parallel/test-repl-setprompt.js b/test/parallel/test-repl-setprompt.js index 8dcc4fe94452da..55e643306df70f 100644 --- a/test/parallel/test-repl-setprompt.js +++ b/test/parallel/test-repl-setprompt.js @@ -23,6 +23,6 @@ child.stdin.end(`e.setPrompt("${p}");${os.EOL}`); child.on('close', function(code, signal) { assert.strictEqual(code, 0); assert.ok(!signal); - const lines = data.split(/\n/); + const lines = data.split('\n'); assert.strictEqual(lines.pop(), p); }); diff --git a/test/parallel/test-stdin-script-child.js b/test/parallel/test-stdin-script-child.js index 81eb3ea5b4aaac..f215682fe4c345 100644 --- a/test/parallel/test-stdin-script-child.js +++ b/test/parallel/test-stdin-script-child.js @@ -18,7 +18,7 @@ child.stdout.on('data', function(c) { child.stderr.setEncoding('utf8'); child.stderr.on('data', function(c) { - console.error(`> ${c.trim().split(/\n/).join('\n> ')}`); + console.error(`> ${c.trim().split('\n').join('\n> ')}`); }); child.on('close', common.mustCall(function(c) {