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.
41 lines
790 B
41 lines
790 B
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
var spawn = require('child_process').spawn;
|
|
|
|
var exitCode;
|
|
var termSignal;
|
|
var gotStdoutEOF = false;
|
|
var gotStderrEOF = false;
|
|
|
|
var cat = spawn(common.isWindows ? 'cmd' : 'cat');
|
|
|
|
|
|
cat.stdout.on('end', function() {
|
|
gotStdoutEOF = true;
|
|
});
|
|
|
|
cat.stderr.on('data', function(chunk) {
|
|
assert.ok(false);
|
|
});
|
|
|
|
cat.stderr.on('end', function() {
|
|
gotStderrEOF = true;
|
|
});
|
|
|
|
cat.on('exit', function(code, signal) {
|
|
exitCode = code;
|
|
termSignal = signal;
|
|
});
|
|
|
|
assert.equal(cat.killed, false);
|
|
cat.kill();
|
|
assert.equal(cat.killed, true);
|
|
|
|
process.on('exit', function() {
|
|
assert.strictEqual(exitCode, null);
|
|
assert.strictEqual(termSignal, 'SIGTERM');
|
|
assert.ok(gotStdoutEOF);
|
|
assert.ok(gotStderrEOF);
|
|
});
|
|
|