mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
676 B
39 lines
676 B
15 years ago
|
require("../common");
|
||
|
|
||
|
var spawn = require('child_process').spawn;
|
||
|
|
||
|
var exitStatus = -1;
|
||
|
var gotStdoutEOF = false;
|
||
|
var gotStderrEOF = false;
|
||
|
|
||
|
var cat = spawn("cat");
|
||
|
|
||
|
|
||
|
cat.stdout.addListener("data", function (chunk) {
|
||
|
assert.ok(false);
|
||
|
});
|
||
|
|
||
|
cat.stdout.addListener("end", function () {
|
||
|
gotStdoutEOF = true;
|
||
|
});
|
||
|
|
||
|
cat.stderr.addListener("data", function (chunk) {
|
||
|
assert.ok(false);
|
||
|
});
|
||
|
|
||
|
cat.stderr.addListener("end", function () {
|
||
|
gotStderrEOF = true;
|
||
|
});
|
||
|
|
||
|
cat.addListener("exit", function (status) {
|
||
|
exitStatus = status;
|
||
|
});
|
||
|
|
||
|
cat.kill();
|
||
|
|
||
|
process.addListener("exit", function () {
|
||
|
assert.ok(exitStatus > 0);
|
||
|
assert.ok(gotStdoutEOF);
|
||
|
assert.ok(gotStderrEOF);
|
||
|
});
|