mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
773fde29a9
PR-URL: https://github.com/nodejs/node/pull/48551 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
26 lines
816 B
JavaScript
26 lines
816 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const assert = require('assert');
|
|
const spawn = require('child_process').spawn;
|
|
const cat = spawn(common.isWindows ? 'cmd' : 'cat');
|
|
|
|
cat.stdout.on('end', common.mustCall());
|
|
cat.stderr.on('data', common.mustNotCall());
|
|
cat.stderr.on('end', common.mustCall());
|
|
|
|
cat.on('exit', common.mustCall((code, signal) => {
|
|
assert.strictEqual(code, null);
|
|
assert.strictEqual(signal, 'SIGTERM');
|
|
assert.strictEqual(cat.signalCode, 'SIGTERM');
|
|
}));
|
|
cat.on('exit', common.mustCall((code, signal) => {
|
|
assert.strictEqual(code, null);
|
|
assert.strictEqual(signal, 'SIGTERM');
|
|
assert.strictEqual(cat.signalCode, 'SIGTERM');
|
|
}));
|
|
|
|
assert.strictEqual(cat.signalCode, null);
|
|
assert.strictEqual(cat.killed, false);
|
|
cat[Symbol.dispose]();
|
|
assert.strictEqual(cat.killed, true);
|