diff options
author | kohta ito <kohta110@gmail.com> | 2018-09-17 18:19:26 +0900 |
---|---|---|
committer | Sam Roberts <vieuxtech@gmail.com> | 2019-04-03 18:32:26 -0700 |
commit | ceb80f415798818a059051537132bba691c68db7 (patch) | |
tree | f384a1a5319edeeb0801db266797be97bfdf06f3 /test/parallel/test-child-process-spawnsync-maxbuf.js | |
parent | b180a1572768a16d14c08d1f847e2b8aa7afe87c (diff) | |
download | android-node-v8-ceb80f415798818a059051537132bba691c68db7.tar.gz android-node-v8-ceb80f415798818a059051537132bba691c68db7.tar.bz2 android-node-v8-ceb80f415798818a059051537132bba691c68db7.zip |
doc: fix default maxBuffer size
Correctly document the default maxBuffer size for execSync,
execFileSync, and spawnSync. It is 200 * 1024, not Infinity.
Add tests to verify behaviour is as documented.
PR-URL: https://github.com/nodejs/node/pull/22894
Reviewed-By: Sam Roberts <vieuxtech@gmail.com>
Diffstat (limited to 'test/parallel/test-child-process-spawnsync-maxbuf.js')
-rw-r--r-- | test/parallel/test-child-process-spawnsync-maxbuf.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/parallel/test-child-process-spawnsync-maxbuf.js b/test/parallel/test-child-process-spawnsync-maxbuf.js index 022c090c33..aec42b555b 100644 --- a/test/parallel/test-child-process-spawnsync-maxbuf.js +++ b/test/parallel/test-child-process-spawnsync-maxbuf.js @@ -32,3 +32,11 @@ const args = [ assert.ifError(ret.error); assert.deepStrictEqual(ret.stdout, msgOutBuf); } + +// maxBuffer size is Infinity at default. +{ + const args = ['-e', "console.log('a'.repeat(200 * 1024))"]; + const ret = spawnSync(process.execPath, args, { encoding: 'utf-8' }); + + assert.ifError(ret.error); +} |