2010-07-16 02:47:25 +08:00
|
|
|
common = require("../common");
|
|
|
|
assert = common.assert
|
2010-03-18 05:00:17 +08:00
|
|
|
|
|
|
|
var spawn = require('child_process').spawn;
|
|
|
|
child = spawn('/usr/bin/env', [], {'HELLO' : 'WORLD'});
|
|
|
|
|
2010-03-04 02:45:58 +08:00
|
|
|
response = "";
|
|
|
|
|
2010-03-18 05:00:17 +08:00
|
|
|
child.stdout.setEncoding('utf8');
|
|
|
|
|
|
|
|
child.stdout.addListener("data", function (chunk) {
|
2010-06-24 08:40:51 +08:00
|
|
|
console.log("stdout: " + chunk);
|
2010-03-18 05:00:17 +08:00
|
|
|
response += chunk;
|
2010-03-04 02:45:58 +08:00
|
|
|
});
|
|
|
|
|
|
|
|
process.addListener('exit', function () {
|
|
|
|
assert.ok(response.indexOf('HELLO=WORLD') >= 0);
|
|
|
|
});
|