| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 781f8c0 commit 272732e
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,15 +87,3 @@ ret = spawnSync(process.execPath, args, { encoding: 'utf8' }); | |||
| 87 | 87 | checkSpawnSyncRet(ret); | |
| 88 | 88 | assert.strictEqual(ret.stdout, msgOut + '\n'); | |
| 89 | 89 | assert.strictEqual(ret.stderr, msgErr + '\n'); | |
| 90 | - | ||
| 91 | - options = { | ||
| 92 | - maxBuffer: 1 | ||
| 93 | - }; | ||
| 94 | - | ||
| 95 | - ret = spawnSync(process.execPath, args, options); | ||
| 96 | - | ||
| 97 | - assert.ok(ret.error, 'maxBuffer should error'); | ||
| 98 | - assert.strictEqual(ret.error.errno, 'ENOBUFS'); | ||
| 99 | - // we can have buffers larger than maxBuffer because underneath we alloc 64k | ||
| 100 | - // that matches our read sizes | ||
| 101 | - assert.deepEqual(ret.stdout, msgOutBuf); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,27 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + require('../common'); | ||
| 3 | + const assert = require('assert'); | ||
| 4 | + | ||
| 5 | + const spawnSync = require('child_process').spawnSync; | ||
| 6 | + | ||
| 7 | + const msgOut = 'this is stdout'; | ||
| 8 | + | ||
| 9 | + // This is actually not os.EOL? | ||
| 10 | + const msgOutBuf = new Buffer(msgOut + '\n'); | ||
| 11 | + | ||
| 12 | + const args = [ | ||
| 13 | + '-e', | ||
| 14 | + `console.log("${msgOut}");` | ||
| 15 | + ]; | ||
| 16 | + | ||
| 17 | + const options = { | ||
| 18 | + maxBuffer: 1 | ||
| 19 | + }; | ||
| 20 | + | ||
| 21 | + const ret = spawnSync(process.execPath, args, options); | ||
| 22 | + | ||
| 23 | + assert.ok(ret.error, 'maxBuffer should error'); | ||
| 24 | + assert.strictEqual(ret.error.errno, 'ENOBUFS'); | ||
| 25 | + // We can have buffers larger than maxBuffer because underneath we alloc 64k | ||
| 26 | + // that matches our read sizes | ||
| 27 | + assert.deepEqual(ret.stdout, msgOutBuf); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments