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.
25 lines
535 B
25 lines
535 B
14 years ago
|
var common = require('../common');
|
||
|
var assert = require('assert');
|
||
14 years ago
|
|
||
14 years ago
|
var exec = require('child_process').exec;
|
||
|
var join = require('path').join;
|
||
15 years ago
|
|
||
14 years ago
|
var nodePath = process.argv[0];
|
||
|
var script = join(common.fixturesDir, 'print-10-lines.js');
|
||
15 years ago
|
|
||
14 years ago
|
var cmd = '"' + nodePath + '" "' + script + '" | head -2';
|
||
15 years ago
|
|
||
14 years ago
|
var finished = false;
|
||
15 years ago
|
|
||
14 years ago
|
exec(cmd, function(err, stdout, stderr) {
|
||
15 years ago
|
if (err) throw err;
|
||
14 years ago
|
var lines = stdout.split('\n');
|
||
15 years ago
|
assert.equal(3, lines.length);
|
||
|
finished = true;
|
||
|
});
|
||
|
|
||
|
|
||
13 years ago
|
process.on('exit', function() {
|
||
15 years ago
|
assert.ok(finished);
|
||
|
});
|