Skip to content

Commit

Permalink
test: fix test-child-process-double-pipe
Browse files Browse the repository at this point in the history
On Windows, grep and sed were stripping the CR character out of CRLF.
Passing --binary will force them to preserve the CR.
  • Loading branch information
[email protected] authored and tjfontaine committed Feb 14, 2014
1 parent 6b4f72b commit e7a03f1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions test/simple/test-child-process-double-pipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,17 @@ var assert = require('assert'),
// We're trying to reproduce:
// $ echo "hello\nnode\nand\nworld" | grep o | sed s/o/a/

var grep = spawn('grep', ['o']),
sed = spawn('sed', ['s/o/O/']),
echo;
var grep, sed, echo;

if (is_windows) {
grep = spawn('grep', ['--binary', 'o']),
sed = spawn('sed', ['--binary', 's/o/O/']),
echo = spawn('cmd.exe',
['/c', 'echo', 'hello&&', 'echo',
'node&&', 'echo', 'and&&', 'echo', 'world']);
} else {
grep = spawn('grep', ['o']),
sed = spawn('sed', ['s/o/O/']),
echo = spawn('echo', ['hello\nnode\nand\nworld\n']);
}

Expand Down

0 comments on commit e7a03f1

Please sign in to comment.