| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent a19de97 commit aebe624
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,23 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + // See https://github.com/nodejs/node/issues/5927 | ||
| 3 | + | ||
| 4 | + const common = require('../common'); | ||
| 5 | + const assert = require('assert'); | ||
| 6 | + const spawn = require('child_process').spawn; | ||
| 7 | + | ||
| 8 | + if (process.argv[2] === 'child') { | ||
| 9 | + process.stdin.pipe(process.stdout); | ||
| 10 | + return; | ||
| 11 | + } | ||
| 12 | + | ||
| 13 | + const child = spawn(process.execPath, [__filename, 'child'], { stdio: 'pipe' }); | ||
| 14 | + | ||
| 15 | + const expectedBytes = 1024 * 1024; | ||
| 16 | + let readBytes = 0; | ||
| 17 | + | ||
| 18 | + child.stdin.end(Buffer.alloc(expectedBytes)); | ||
| 19 | + | ||
| 20 | + child.stdout.on('data', (chunk) => readBytes += chunk.length); | ||
| 21 | + child.stdout.on('end', common.mustCall(() => { | ||
| 22 | + assert.strictEqual(readBytes, expectedBytes); | ||
| 23 | + })); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments