Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
Add some debug output to test-child-process-double-pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed Aug 12, 2011
1 parent 3a219de commit 2c11718
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/simple/test-child-process-double-pipe.js
Expand Up @@ -44,6 +44,7 @@ var echo = spawn('echo', ['hello\nnode\nand\nworld\n']),

// pipe echo | grep
echo.stdout.on('data', function(data) {
console.error("grep stdin write " + data.length);
if (!grep.stdin.write(data)) {
echo.stdout.pause();
}
Expand All @@ -58,10 +59,23 @@ echo.stdout.on('end', function(code) {
grep.stdin.end();
});

echo.on('exit', function() {
console.error("echo exit");
})

grep.on('exit', function() {
console.error("grep exit");
})

sed.on('exit', function() {
console.error("sed exit");
})



// pipe grep | sed
grep.stdout.on('data', function(data) {
console.error("grep stdout " + data.length);
if (!sed.stdin.write(data)) {
grep.stdout.pause();
}
Expand All @@ -73,6 +87,7 @@ sed.stdin.on('drain', function(data) {

// propagate end from grep to sed
grep.stdout.on('end', function(code) {
console.error("grep stdout end");
sed.stdin.end();
});

Expand Down

0 comments on commit 2c11718

Please sign in to comment.