Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: use string instead of RegExp in split()
  • Loading branch information
vsemozhetbyt committed Jun 18, 2017
commit c0f649d6a09fa552f6b0ad7d089c7f0819122f8b
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-repl-setprompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,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);
});
2 changes: 1 addition & 1 deletion test/parallel/test-stdin-script-child.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ for (const args of [[], ['-']]) {

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) {
Expand Down