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.
29 lines
634 B
29 lines
634 B
14 years ago
|
var common = require('../common');
|
||
|
var assert = require('assert');
|
||
15 years ago
|
var path = require('path');
|
||
|
var spawn = require('child_process').spawn;
|
||
15 years ago
|
var sub = path.join(common.fixturesDir, 'print-chars.js');
|
||
15 years ago
|
|
||
14 years ago
|
var n = 500000;
|
||
15 years ago
|
|
||
|
var child = spawn(process.argv[0], [sub, n]);
|
||
|
|
||
|
var count = 0;
|
||
|
|
||
|
child.stderr.setEncoding('utf8');
|
||
13 years ago
|
child.stderr.on('data', function(data) {
|
||
14 years ago
|
console.log('parent stderr: ' + data);
|
||
15 years ago
|
assert.ok(false);
|
||
|
});
|
||
|
|
||
13 years ago
|
child.stdout.setEncoding('utf8');
|
||
13 years ago
|
child.stdout.on('data', function(data) {
|
||
15 years ago
|
count += data.length;
|
||
15 years ago
|
console.log(count);
|
||
15 years ago
|
});
|
||
|
|
||
13 years ago
|
child.on('close', function(data) {
|
||
15 years ago
|
assert.equal(n, count);
|
||
14 years ago
|
console.log('okay');
|
||
15 years ago
|
});
|