test: add batch of known issue tests
[platform/upstream/nodejs.git] / test / known_issues / test-child-process-max-buffer.js
1 'use strict';
2 // Refs: https://github.com/nodejs/node/issues/1901
3 const common = require('../common');
4 const assert = require('assert');
5 const cp = require('child_process');
6 const unicode = '中文测试'; // Length = 4, Byte length = 13
7
8 if (process.argv[2] === 'child') {
9   console.log(unicode);
10 } else {
11   const cmd = `${process.execPath} ${__filename} child`;
12
13   cp.exec(cmd, { maxBuffer: 10 }, common.mustCall((err, stdout, stderr) => {
14     assert.strictEqual(err.message, 'stdout maxBuffer exceeded');
15   }));
16 }