From e7a03f1c62414192bd96a8214e699a07051fa11e Mon Sep 17 00:00:00 2001 From: "orangemocha@github.com" Date: Mon, 10 Feb 2014 22:41:03 +0100 Subject: [PATCH] test: fix test-child-process-double-pipe On Windows, grep and sed were stripping the CR character out of CRLF. Passing --binary will force them to preserve the CR. --- test/simple/test-child-process-double-pipe.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/simple/test-child-process-double-pipe.js b/test/simple/test-child-process-double-pipe.js index ff092062202d2e..c09dfa885327e6 100644 --- a/test/simple/test-child-process-double-pipe.js +++ b/test/simple/test-child-process-double-pipe.js @@ -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']); }