|
|
@ -3,32 +3,32 @@ process.mixin(require("./common")); |
|
|
|
success_count = 0; |
|
|
|
error_count = 0; |
|
|
|
|
|
|
|
exec("ls /").addCallback(function (out) { |
|
|
|
success_count++; |
|
|
|
p(out); |
|
|
|
}).addErrback(function (code, out, err) { |
|
|
|
exec("ls /", function (err, stdout, stderr) { |
|
|
|
if (err) { |
|
|
|
error_count++; |
|
|
|
puts("error!: " + code); |
|
|
|
puts("stdout: " + JSON.stringify(out)); |
|
|
|
puts("stderr: " + JSON.stringify(err)); |
|
|
|
puts("error!: " + err.code); |
|
|
|
puts("stdout: " + JSON.stringify(stdout)); |
|
|
|
puts("stderr: " + JSON.stringify(stderr)); |
|
|
|
} else { |
|
|
|
success_count++; |
|
|
|
p(stdout); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
exec("ls /DOES_NOT_EXIST").addCallback(function (out) { |
|
|
|
success_count++; |
|
|
|
p(out); |
|
|
|
assert.equal(true, out != ""); |
|
|
|
|
|
|
|
}).addErrback(function (code, out, err) { |
|
|
|
exec("ls /DOES_NOT_EXIST", function (err, stdout, stderr) { |
|
|
|
if (err) { |
|
|
|
error_count++; |
|
|
|
|
|
|
|
assert.equal("", out); |
|
|
|
assert.equal(true, code != 0); |
|
|
|
|
|
|
|
puts("error!: " + code); |
|
|
|
puts("stdout: " + JSON.stringify(out)); |
|
|
|
puts("stderr: " + JSON.stringify(err)); |
|
|
|
assert.equal("", stdout); |
|
|
|
assert.equal(true, err.code != 0); |
|
|
|
puts("error code: " + err.code); |
|
|
|
puts("stdout: " + JSON.stringify(stdout)); |
|
|
|
puts("stderr: " + JSON.stringify(stderr)); |
|
|
|
} else { |
|
|
|
success_count++; |
|
|
|
p(stdout); |
|
|
|
assert.equal(true, stdout != ""); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|