Skip to content

Commit 7e3bab7

Browse files
vsemozhetbytaddaleax
authored andcommitted
test: use string instead of RegExp in split()
PR-URL: #13710 Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gibson Fahnestock <[email protected]> Reviewed-By: Michaël Zasso <[email protected]>
1 parent 0e857a5 commit 7e3bab7

3 files changed

+3
-3
lines changed

test/parallel/test-http-outgoing-first-chunk-singlebyte-encoding.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ for (const enc of ['utf8', 'utf16le', 'latin1', 'UTF-8']) {
2424
const headerEnd = received.indexOf('\r\n\r\n', 'utf8');
2525
assert.notStrictEqual(headerEnd, -1);
2626

27-
const header = received.toString('utf8', 0, headerEnd).split(/\r\n/);
27+
const header = received.toString('utf8', 0, headerEnd).split('\r\n');
2828
const body = received.toString(enc, headerEnd + 4);
2929

3030
assert.strictEqual(header[0], 'HTTP/1.1 200 OK');

test/parallel/test-repl-setprompt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ child.stdin.end(`e.setPrompt("${p}");${os.EOL}`);
4444
child.on('close', function(code, signal) {
4545
assert.strictEqual(code, 0);
4646
assert.ok(!signal);
47-
const lines = data.split(/\n/);
47+
const lines = data.split('\n');
4848
assert.strictEqual(lines.pop(), p);
4949
});

test/parallel/test-stdin-script-child.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ for (const args of [[], ['-']]) {
1919

2020
child.stderr.setEncoding('utf8');
2121
child.stderr.on('data', function(c) {
22-
console.error(`> ${c.trim().split(/\n/).join('\n> ')}`);
22+
console.error(`> ${c.trim().split('\n').join('\n> ')}`);
2323
});
2424

2525
child.on('close', common.mustCall(function(c) {

0 commit comments

Comments
 (0)