mirror of
https://github.com/nodejs/node.git
synced 2025-04-30 23:56:58 +00:00

In addition to removing unused vars, this also fixes an instance where booleans were set presumably to check something but then never used. This now confirms that the events that were setting the booleans are fired. PR-URL: https://github.com/nodejs/node/pull/4425 Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
36 lines
804 B
JavaScript
36 lines
804 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
var spawn = require('child_process').spawn;
|
|
|
|
if (process.argv[2] === 'parent')
|
|
parent();
|
|
else
|
|
grandparent();
|
|
|
|
function grandparent() {
|
|
var child = spawn(process.execPath, [__filename, 'parent']);
|
|
child.stderr.pipe(process.stderr);
|
|
var output = '';
|
|
var input = 'asdfasdf';
|
|
|
|
child.stdout.on('data', function(chunk) {
|
|
output += chunk;
|
|
});
|
|
child.stdout.setEncoding('utf8');
|
|
|
|
child.stdin.end(input);
|
|
|
|
child.on('close', function(code, signal) {
|
|
assert.equal(code, 0);
|
|
assert.equal(signal, null);
|
|
// cat on windows adds a \r\n at the end.
|
|
assert.equal(output.trim(), input.trim());
|
|
});
|
|
}
|
|
|
|
function parent() {
|
|
// should not immediately exit.
|
|
common.spawnCat({ stdio: 'inherit' });
|
|
}
|