| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 566e2fe commit 98e32db
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,28 +2,15 @@ | |||
| 2 | 2 | const common = require('../common'); | |
| 3 | 3 | const assert = require('assert'); | |
| 4 | 4 | const spawn = require('child_process').spawn; | |
| 5 | + const fs = require('fs'); | ||
| 5 | 6 | ||
| 6 | 7 | if (common.isWindows) { | |
| 7 | 8 | common.skip('platform not supported.'); | |
| 8 | 9 | return; | |
| 9 | 10 | } | |
| 10 | 11 | ||
| 11 | 12 | if (process.argv[2] === 'child') { | |
| 12 | - try { | ||
| 13 | - process.stdout.write('stdout', function() { | ||
| 14 | - try { | ||
| 15 | - process.stderr.write('stderr', function() { | ||
| 16 | - process.exit(42); | ||
| 17 | - }); | ||
| 18 | - } catch (e) { | ||
| 19 | - process.exit(84); | ||
| 20 | - } | ||
| 21 | - }); | ||
| 22 | - } catch (e) { | ||
| 23 | - assert.strictEqual(e.code, 'EBADF'); | ||
| 24 | - assert.strictEqual(e.message, 'EBADF: bad file descriptor, write'); | ||
| 25 | - process.exit(126); | ||
| 26 | - } | ||
| 13 | + [0, 1, 2].forEach((i) => assert.doesNotThrow(() => fs.fstatSync(i))); | ||
| 27 | 14 | return; | |
| 28 | 15 | } | |
| 29 | 16 | ||
@@ -32,5 +19,5 @@ const cmd = `"${process.execPath}" "${__filename}" child 1>&- 2>&-`; | |||
| 32 | 19 | const proc = spawn('/bin/sh', ['-c', cmd], { stdio: 'inherit' }); | |
| 33 | 20 | ||
| 34 | 21 | proc.on('exit', common.mustCall(function(exitCode) { | |
| 35 | - assert.strictEqual(exitCode, common.isAix ? 126 : 42); | ||
| 22 | + assert.strictEqual(exitCode, 0); | ||
| 36 | 23 | })); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments