|
@ -5,6 +5,10 @@ var path = require('path'); |
|
|
var exec = require('child_process').exec; |
|
|
var exec = require('child_process').exec; |
|
|
var async_completed = 0, async_expected = 0, unlink = []; |
|
|
var async_completed = 0, async_expected = 0, unlink = []; |
|
|
|
|
|
|
|
|
|
|
|
function tmp (p) { |
|
|
|
|
|
return path.join(common.tmpDir, p); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
function asynctest(testBlock, args, callback, assertBlock) { |
|
|
function asynctest(testBlock, args, callback, assertBlock) { |
|
|
async_expected++; |
|
|
async_expected++; |
|
|
testBlock.apply(testBlock, args.concat(function(err){ |
|
|
testBlock.apply(testBlock, args.concat(function(err){ |
|
@ -200,16 +204,16 @@ function test_deep_symlink_mix(callback) { |
|
|
/node/test/fixtures/nested-index/two/realpath-c -> ../../cycles/root.js |
|
|
/node/test/fixtures/nested-index/two/realpath-c -> ../../cycles/root.js |
|
|
/node/test/fixtures/cycles/root.js (hard) |
|
|
/node/test/fixtures/cycles/root.js (hard) |
|
|
*/ |
|
|
*/ |
|
|
var entry = '/tmp/node-test-realpath-f1'; |
|
|
var entry = tmp('node-test-realpath-f1'); |
|
|
try {fs.unlinkSync('/tmp/node-test-realpath-d2/foo');}catch(e){} |
|
|
try { fs.unlinkSync(tmp('node-test-realpath-d2/foo')); } catch (e) {} |
|
|
try {fs.rmdirSync('/tmp/node-test-realpath-d2');}catch(e){} |
|
|
try { fs.rmdirSync(tmp('node-test-realpath-d2')); } catch(e) {} |
|
|
fs.mkdirSync('/tmp/node-test-realpath-d2', 0700); |
|
|
fs.mkdirSync(tmp('node-test-realpath-d2'), 0700); |
|
|
try { |
|
|
try { |
|
|
[ |
|
|
[ |
|
|
[entry, '../tmp/node-test-realpath-d1/foo'], |
|
|
[entry, '../tmp/node-test-realpath-d1/foo'], |
|
|
['/tmp/node-test-realpath-d1', '../tmp/node-test-realpath-d2'], |
|
|
[tmp('node-test-realpath-d1'), '../tmp/node-test-realpath-d2'], |
|
|
['/tmp/node-test-realpath-d2/foo', '../node-test-realpath-f2'], |
|
|
[tmp('node-test-realpath-d2/foo'), '../node-test-realpath-f2'], |
|
|
['/tmp/node-test-realpath-f2', fixturesAbsDir+'/nested-index/one/realpath-c'], |
|
|
[tmp('node-test-realpath-f2'), fixturesAbsDir+'/nested-index/one/realpath-c'], |
|
|
[fixturesAbsDir+'/nested-index/one/realpath-c', fixturesAbsDir+'/nested-index/two/realpath-c'], |
|
|
[fixturesAbsDir+'/nested-index/one/realpath-c', fixturesAbsDir+'/nested-index/two/realpath-c'], |
|
|
[fixturesAbsDir+'/nested-index/two/realpath-c', '../../cycles/root.js'], |
|
|
[fixturesAbsDir+'/nested-index/two/realpath-c', '../../cycles/root.js'], |
|
|
].forEach(function(t) { |
|
|
].forEach(function(t) { |
|
@ -219,7 +223,7 @@ function test_deep_symlink_mix(callback) { |
|
|
unlink.push(t[0]); |
|
|
unlink.push(t[0]); |
|
|
}); |
|
|
}); |
|
|
} finally { |
|
|
} finally { |
|
|
unlink.push('/tmp/node-test-realpath-d2'); |
|
|
unlink.push(tmp('node-test-realpath-d2')); |
|
|
} |
|
|
} |
|
|
var expected = fixturesAbsDir+'/cycles/root.js'; |
|
|
var expected = fixturesAbsDir+'/cycles/root.js'; |
|
|
assert.equal(fs.realpathSync(entry), expected); |
|
|
assert.equal(fs.realpathSync(entry), expected); |
|
|