mirror of
https://github.com/nodejs/node.git
synced 2025-05-06 11:29:26 +00:00

Only `test-stdin-from-file.js` has been modified so that the `stdin.txt` is written in a temp directory instead of the `fixtures` directory. PR-URL: https://github.com/nodejs/node/pull/6187 Reviewed-By: James M Snell <jasnell@gmail.com>
26 lines
549 B
JavaScript
26 lines
549 B
JavaScript
'use strict';
|
|
var common = require('../common');
|
|
var assert = require('assert');
|
|
|
|
var exec = require('child_process').exec;
|
|
var join = require('path').join;
|
|
|
|
var nodePath = process.argv[0];
|
|
var script = join(common.fixturesDir, 'print-10-lines.js');
|
|
|
|
var cmd = '"' + nodePath + '" "' + script + '" | head -2';
|
|
|
|
var finished = false;
|
|
|
|
exec(cmd, function(err, stdout, stderr) {
|
|
if (err) throw err;
|
|
var lines = stdout.split('\n');
|
|
assert.equal(3, lines.length);
|
|
finished = true;
|
|
});
|
|
|
|
|
|
process.on('exit', function() {
|
|
assert.ok(finished);
|
|
});
|