| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 14fead0 commit 7e03117
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,28 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const assert = require('assert'); | ||
| 4 | + const child_process = require('child_process'); | ||
| 5 | + const path = require('path'); | ||
| 6 | + const fs = require('fs'); | ||
| 7 | + | ||
| 8 | + assert.strictEqual(process.execPath, fs.realpathSync(process.execPath)); | ||
| 9 | + | ||
| 10 | + if (common.isWindows) { | ||
| 11 | + common.skip('symlinks are weird on windows'); | ||
| 12 | + return; | ||
| 13 | + } | ||
| 14 | + | ||
| 15 | + if (process.argv[2] === 'child') { | ||
| 16 | + // The console.log() output is part of the test here. | ||
| 17 | + console.log(process.execPath); | ||
| 18 | + } else { | ||
| 19 | + common.refreshTmpDir(); | ||
| 20 | + | ||
| 21 | + const symlinkedNode = path.join(common.tmpDir, 'symlinked-node'); | ||
| 22 | + fs.symlinkSync(process.execPath, symlinkedNode); | ||
| 23 | + | ||
| 24 | + const proc = child_process.spawnSync(symlinkedNode, [__filename, 'child']); | ||
| 25 | + assert.strictEqual(proc.stderr.toString(), ''); | ||
| 26 | + assert.strictEqual(proc.stdout.toString(), `${process.execPath}\n`); | ||
| 27 | + assert.strictEqual(proc.status, 0); | ||
| 28 | + } | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments