mirror of
https://github.com/nodejs/node.git
synced 2024-11-29 23:16:30 +01:00
29 lines
513 B
JavaScript
29 lines
513 B
JavaScript
process.mixin(require("./common"));
|
|
|
|
var sub = path.join(fixturesDir, 'print-chars.js');
|
|
|
|
n = 100000;
|
|
|
|
var child = process.createChildProcess(process.argv[0], [sub, n]);
|
|
|
|
var count = 0;
|
|
|
|
child.addListener("error", function (data){
|
|
if (data) {
|
|
puts("parent stderr: " + data);
|
|
assert.ok(false);
|
|
}
|
|
});
|
|
|
|
child.addListener("output", function (data){
|
|
if (data) {
|
|
count += data.length;
|
|
puts(count);
|
|
}
|
|
});
|
|
|
|
child.addListener("exit", function (data) {
|
|
assert.equal(n, count);
|
|
puts("okay");
|
|
});
|