Skip to content

Commit 8309337

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 f28f23f commit 8309337

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

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

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

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

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

‎test/parallel/test-repl-setprompt.js‎

Lines changed: 1 addition & 1 deletion
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-
constlines=data.split(/\n/);
47+
constlines=data.split('\n');
4848
assert.strictEqual(lines.pop(),p);
4949
});

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

Lines changed: 1 addition & 1 deletion
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)