mirror of
https://github.com/nodejs/node.git
synced 2025-05-17 16:40:19 +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>
37 lines
805 B
JavaScript
37 lines
805 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
var assert = require('assert');
|
|
var exec = require('child_process').exec;
|
|
|
|
var success_count = 0;
|
|
var error_count = 0;
|
|
|
|
var pwdcommand, dir;
|
|
|
|
if (common.isWindows) {
|
|
pwdcommand = 'echo %cd%';
|
|
dir = 'c:\\windows';
|
|
} else {
|
|
pwdcommand = 'pwd';
|
|
dir = '/dev';
|
|
}
|
|
|
|
exec(pwdcommand, {cwd: dir}, function(err, stdout, stderr) {
|
|
if (err) {
|
|
error_count++;
|
|
console.log('error!: ' + err.code);
|
|
console.log('stdout: ' + JSON.stringify(stdout));
|
|
console.log('stderr: ' + JSON.stringify(stderr));
|
|
assert.equal(false, err.killed);
|
|
} else {
|
|
success_count++;
|
|
console.log(stdout);
|
|
assert.ok(stdout.indexOf(dir) == 0);
|
|
}
|
|
});
|
|
|
|
process.on('exit', function() {
|
|
assert.equal(1, success_count);
|
|
assert.equal(0, error_count);
|
|
});
|