mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 18:44:40 +00:00

In the tests, we use "process.platform === 'win32'" in some places. This patch replaces them with the "common.isWindows" for consistency. PR-URL: https://github.com/nodejs/io.js/pull/2269 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
42 lines
790 B
JavaScript
42 lines
790 B
JavaScript
'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);
|
|
});
|