Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fixup!
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
avivkeller and aduh95 committed Sep 23, 2024
commit 84cf4668ee906bdc91d5ed717898722773eabfa4
8 changes: 3 additions & 5 deletions test/parallel/test-repl-preview-newlines.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,10 @@ repl.start({
let output = '';
outputStream.write = (chunk) => output += chunk;

const testChars = ['\\n', '\\v', '\\r'];

for (const test of testChars) {
inputStream.emit('data', `"${test}"()`);
for (const testChar of '\n\v\r') {
inputStream.emit('data', `${JSON.stringify(testChar)}()`);
// Make sure the output is on a single line
assert.strictEqual(output, `"${test}"()\n\x1B[90mTypeError: "\x1B[39m\x1B[9G\x1B[1A`);
assert.strictEqual(output, `${JSON.stringify(testChar)}()\n\x1B[90mTypeError: "\x1B[39m\x1B[9G\x1B[1A`);
inputStream.run(['']);
output = '';
}