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.
30 lines
630 B
30 lines
630 B
15 years ago
|
process.mixin(require("../common"));
|
||
16 years ago
|
|
||
|
var pwd_called = false;
|
||
|
|
||
|
function pwd (callback) {
|
||
|
var output = "";
|
||
15 years ago
|
var child = process.createChildProcess("pwd");
|
||
16 years ago
|
child.addListener("output", function (s) {
|
||
16 years ago
|
puts("stdout: " + JSON.stringify(s));
|
||
16 years ago
|
if (s) output += s;
|
||
16 years ago
|
});
|
||
16 years ago
|
child.addListener("exit", function (c) {
|
||
16 years ago
|
puts("exit: " + c);
|
||
15 years ago
|
assert.equal(0, c);
|
||
16 years ago
|
callback(output);
|
||
|
pwd_called = true;
|
||
16 years ago
|
});
|
||
16 years ago
|
}
|
||
|
|
||
|
|
||
16 years ago
|
pwd(function (result) {
|
||
16 years ago
|
p(result);
|
||
15 years ago
|
assert.equal(true, result.length > 1);
|
||
|
assert.equal("\n", result[result.length-1]);
|
||
16 years ago
|
});
|
||
16 years ago
|
|
||
16 years ago
|
process.addListener("exit", function () {
|
||
15 years ago
|
assert.equal(true, pwd_called);
|
||
16 years ago
|
});
|