mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
836 B
39 lines
836 B
15 years ago
|
process.mixin(require("../common"));
|
||
16 years ago
|
|
||
|
success_count = 0;
|
||
|
error_count = 0;
|
||
|
|
||
15 years ago
|
exec("ls /", function (err, stdout, stderr) {
|
||
|
if (err) {
|
||
|
error_count++;
|
||
|
puts("error!: " + err.code);
|
||
|
puts("stdout: " + JSON.stringify(stdout));
|
||
|
puts("stderr: " + JSON.stringify(stderr));
|
||
|
} else {
|
||
|
success_count++;
|
||
|
p(stdout);
|
||
|
}
|
||
16 years ago
|
});
|
||
|
|
||
|
|
||
15 years ago
|
exec("ls /DOES_NOT_EXIST", function (err, stdout, stderr) {
|
||
|
if (err) {
|
||
|
error_count++;
|
||
|
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 != "");
|
||
|
}
|
||
16 years ago
|
});
|
||
|
|
||
|
|
||
|
process.addListener("exit", function () {
|
||
15 years ago
|
assert.equal(1, success_count);
|
||
|
assert.equal(1, error_count);
|
||
16 years ago
|
});
|