node/test/simple/test-process-kill.js

16 lines
427 B
JavaScript
Raw Normal View History

2010-02-25 14:36:17 +08:00
process.mixin(require("../common"));
2009-06-21 20:06:03 +08:00
var exit_status = -1;
var cat = process.createChildProcess("cat");
cat.addListener("output", function (chunk) { assert.equal(null, chunk); });
cat.addListener("error", function (chunk) { assert.equal(null, chunk); });
2009-08-27 00:22:00 +08:00
cat.addListener("exit", function (status) { exit_status = status; });
2009-06-21 20:06:03 +08:00
2009-08-27 00:22:00 +08:00
cat.kill();
2009-06-21 20:06:03 +08:00
process.addListener("exit", function () {
assert.equal(true, exit_status > 0);
});