mirror of
https://github.com/nodejs/node.git
synced 2025-05-02 03:31:35 +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>
27 lines
689 B
JavaScript
27 lines
689 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
var spawn = require('child_process').spawn;
|
|
|
|
if (common.isWindows) {
|
|
console.log('1..0 # Skipped: platform not supported.');
|
|
return;
|
|
}
|
|
|
|
if (process.argv[2] === 'child') {
|
|
process.stdout.write('stdout', function() {
|
|
process.stderr.write('stderr', function() {
|
|
process.exit(42);
|
|
});
|
|
});
|
|
return;
|
|
}
|
|
|
|
// Run the script in a shell but close stdout and stderr.
|
|
var cmd = '"' + process.execPath + '" "' + __filename + '" child 1>&- 2>&-';
|
|
var proc = spawn('/bin/sh', ['-c', cmd], { stdio: 'inherit' });
|
|
|
|
proc.on('exit', common.mustCall(function(exitCode) {
|
|
assert.equal(exitCode, 42);
|
|
}));
|