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.

18 lines
476 B

'use strict';
const common = require('../common');
const assert = require('assert');
14 years ago
const exec = require('child_process').exec;
const join = require('path').join;
const nodePath = process.argv[0];
const script = join(common.fixturesDir, 'print-10-lines.js');
const cmd = `"${nodePath}" "${script}" | head -2`;
exec(cmd, common.mustCall(function(err, stdout, stderr) {
assert.ifError(err);
const lines = stdout.split('\n');
assert.strictEqual(3, lines.length);
}));