Skip to content

Commit

Permalink
test: add known_issues test for nodejsGH-2148
Browse files Browse the repository at this point in the history
  • Loading branch information
Trott committed Mar 28, 2016
1 parent a17200b commit d0f677a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/known_issues/test-stdout-buffer-flush-on-exit.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use strict';
// Refs: https://github.com/nodejs/node/issues/2148
require('../common');
const assert = require('assert');
const execSync = require('child_process').execSync;

const longLine = 'foo bar baz quux quuz aaa bbb ccc'.repeat(80);
const expectedLength = (longLine.length * 999) + 1;

if (process.argv[2] === 'child') {
process.on('exit', () => {
console.log(longLine.repeat(999));
});
process.exit();
}

const stdout = execSync(`${process.execPath} ${__filename} child`);

assert.strictEqual(stdout.length, expectedLength);

0 comments on commit d0f677a

Please sign in to comment.