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>
This commit is contained in:
JungMinu authored and cjihrig committed 2016-08-15 09:51:17 -04:00
1 parent 2db26cb165
commit 08e6eeee70
19 files changed
+201 -191

No files matched your search

+2 -2
View File
@@ -30,7 +30,7 @@ execFile(node, noDep, function(er, stdout, stderr) {
console.error('--no-deprecation: silence deprecations');
assert.equal(er, null);
assert.equal(stdout, '');
assert.equal(stderr, 'DEBUG: This is deprecated\n');
assert.equal(stderr, 'DEBUG: This is deprecated\r\n');
console.log('silent ok');
});
@@ -38,7 +38,7 @@ execFile(node, traceDep, function(er, stdout, stderr) {
console.error('--trace-deprecation: show stack');
assert.equal(er, null);
assert.equal(stdout, '');
var stack = stderr.trim().split('\n');
var stack = stderr.trim().split('\r\n');
// just check the top and bottom.
assert(/util.debug is deprecated. Use console.error instead./.test(stack[1]));
assert(/DEBUG: This is deprecated/.test(stack[0]));