1 var common = require('../common');
2 var assert = require('assert');
3 var child_process = require('child_process');
5 function test(fun, code) {
8 fun('does-not-exist', function(err) {
9 assert.equal(err.code, code);
10 assert(/does\-not\-exist/.test(err.cmd));
14 process.on('exit', function() {
15 assert.equal(errors, 1);
19 if (process.platform === 'win32') {
20 test(child_process.exec, 1); // exit code of cmd.exe
22 test(child_process.exec, 127); // exit code of /bin/sh
25 test(child_process.execFile, 'ENOENT');