summaryrefslogtreecommitdiff
path: root/test/parallel/test-repl-sigint.js
diff options
context:
space:
mode:
authorJungMinu <jmwsoft@gmail.com>2016-08-09 00:55:19 +0900
committerJungMinu <jmwsoft@gmail.com>2016-08-13 23:03:30 +0900
commitfce4b981eacbce0b85a2418d042f1f67d40e9834 (patch)
treebc8a170ad3193ab02c1210e94218e6230fec302b /test/parallel/test-repl-sigint.js
parent6a3dbdacd6cf67f643dee219fd782a193ddd2534 (diff)
downloadandroid-node-v8-fce4b981eacbce0b85a2418d042f1f67d40e9834.tar.gz
android-node-v8-fce4b981eacbce0b85a2418d042f1f67d40e9834.tar.bz2
android-node-v8-fce4b981eacbce0b85a2418d042f1f67d40e9834.zip
repl,util: insert carriage returns in output
`\n` is not enough for Linux with some custom stream add carriage returns to ensure that the output is displayed correctly using `\r\n` should not be a problem, even on non-Windows platforms. Fixes: https://github.com/nodejs/node/issues/7954 PR-URL: https://github.com/nodejs/node/pull/8028 Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Diffstat (limited to 'test/parallel/test-repl-sigint.js')
-rw-r--r--test/parallel/test-repl-sigint.js9
1 files changed, 5 insertions, 4 deletions
diff --git a/test/parallel/test-repl-sigint.js b/test/parallel/test-repl-sigint.js
index 5ee974aaea..303973194f 100644
--- a/test/parallel/test-repl-sigint.js
+++ b/test/parallel/test-repl-sigint.js
@@ -34,17 +34,18 @@ child.stdout.once('data', common.mustCall(() => {
process.kill(child.pid, 'SIGINT');
child.stdout.once('data', common.mustCall(() => {
// Make sure state from before the interruption is still available.
- child.stdin.end('a*2*3*7\n');
+ child.stdin.end('a*2*3*7\r\n');
}));
}));
child.stdin.write('a = 1001;' +
'process.kill(+process.env.REPL_TEST_PPID, "SIGUSR2");' +
- 'while(true){}\n');
+ 'while(true){}\r\n');
}));
child.on('close', function(code) {
assert.strictEqual(code, 0);
- assert.notStrictEqual(stdout.indexOf('Script execution interrupted.\n'), -1);
- assert.notStrictEqual(stdout.indexOf('42042\n'), -1);
+ assert.notStrictEqual(stdout.indexOf('Script execution interrupted.' +
+ '\r\n'), -1);
+ assert.notStrictEqual(stdout.indexOf('42042\r\n'), -1);
});