@ -37,11 +37,14 @@ function tmp(p) {
return path . join ( common . tmpDir , p ) ;
}
var fixture sAbsDir = common . fixturesDir ;
var target sAbsDir = path . join ( common . tmpDir , 'targets' ) ;
var tmpAbsDir = common . tmpDir ;
assert ( fixturesAbsDir !== tmpAbsDir ) ;
console . error ( 'absolutes\n%s\n%s' , fixturesAbsDir , tmpAbsDir ) ;
// Set up targetsAbsDir and expected subdirectories
fs . mkdirSync ( targetsAbsDir ) ;
fs . mkdirSync ( path . join ( targetsAbsDir , 'nested-index' ) ) ;
fs . mkdirSync ( path . join ( targetsAbsDir , 'nested-index' , 'one' ) ) ;
fs . mkdirSync ( path . join ( targetsAbsDir , 'nested-index' , 'two' ) ) ;
function asynctest ( testBlock , args , callback , assertBlock ) {
async_expected ++ ;
@ -109,7 +112,7 @@ function test_simple_absolute_symlink(callback) {
console . log ( 'using type=%s' , type ) ;
var entry = tmpAbsDir + '/symlink' ,
expected = fixturesAb sDir + '/nested-index/one' ;
expected = common . fixturesDir + '/nested-index/one' ;
[
[ entry , expected ]
] . forEach ( function ( t ) {
@ -133,14 +136,15 @@ function test_deep_relative_file_symlink(callback) {
}
var expected = path . join ( common . fixturesDir , 'cycles' , 'root.js' ) ;
var linkData1 = '../../cycles/root.js' ;
var linkPath1 = path . join ( common . fixturesDir ,
var linkData1 = path . relative ( path . join ( targetsAbsDir , 'nested-index' , 'one' ) ,
expected ) ;
var linkPath1 = path . join ( targetsAbsDir ,
'nested-index' , 'one' , 'symlink1.js' ) ;
try { fs . unlinkSync ( linkPath1 ) ; } catch ( e ) { }
fs . symlinkSync ( linkData1 , linkPath1 , 'file' ) ;
var linkData2 = '../one/symlink1.js' ;
var entry = path . join ( common . fixture sDir,
var entry = path . join ( targetsAb sDir,
'nested-index' , 'two' , 'symlink1-b.js' ) ;
try { fs . unlinkSync ( entry ) ; } catch ( e ) { }
fs . symlinkSync ( linkData2 , entry , 'file' ) ;
@ -160,14 +164,14 @@ function test_deep_relative_dir_symlink(callback) {
return runNextTest ( ) ;
}
var expected = path . join ( common . fixturesDir , 'cycles' , 'folder' ) ;
var linkData1b = '../../cycles/folder' ;
var linkPath1b = path . join ( common . fixturesDir ,
'nested-index' , 'one' , 'symlink1-dir' ) ;
var path1b = path . join ( targetsAbsDir , 'nested-index' , 'one' ) ;
var linkPath1b = path . join ( path1b , 'symlink1-dir' ) ;
var linkData1b = path . relative ( path1b , expected ) ;
try { fs . unlinkSync ( linkPath1b ) ; } catch ( e ) { }
fs . symlinkSync ( linkData1b , linkPath1b , 'dir' ) ;
var linkData2b = '../one/symlink1-dir' ;
var entry = path . join ( common . fixture sDir,
var entry = path . join ( targetsAb sDir,
'nested-index' , 'two' , 'symlink12-dir' ) ;
try { fs . unlinkSync ( entry ) ; } catch ( e ) { }
fs . symlinkSync ( linkData2b , entry , 'dir' ) ;
@ -276,11 +280,11 @@ function test_deep_symlink_mix(callback) {
/ t m p / n o d e - t e s t - r e a l p a t h - d 1 - > $ t m p D i r / n o d e - t e s t - r e a l p a t h - d 2
/ t m p / n o d e - t e s t - r e a l p a t h - d 2 / f o o - > $ t m p D i r / n o d e - t e s t - r e a l p a t h - f 2
/ t m p / n o d e - t e s t - r e a l p a t h - f 2
- > / n o d e / t e s t / f i x t u r e s / n e s t e d - i n d e x / o n e / r e a l p a t h - c
/ n o d e / t e s t / f i x t u r e s / n e s t e d - i n d e x / o n e / r e a l p a t h - c
- > / n o d e / t e s t / f i x t u r e s / n e s t e d - i n d e x / t w o / r e a l p a t h - c
/ n o d e / t e s t / f i x t u r e s / n e s t e d - i n d e x / t w o / r e a l p a t h - c - > $ t m p D i r / c y c l e s / r o o t . j s
/ n o d e / t e s t / f i x t u r e s / c y c l e s / r o o t . j s ( h a r d )
- > $tmpDir / targets / nested - index / one / realpath - c
$tmpDir / targets / nested - index / one / realpath - c
- > $tmpDir / targets / nested - index / two / realpath - c
$tmpDir / targets / nested - index / two / realpath - c - > $tmpDir / cycles / root . j s
$tmpDir / targets / cycles / root . js ( hard )
* /
var entry = tmp ( 'node-test-realpath-f1' ) ;
try { fs . unlinkSync ( tmp ( 'node-test-realpath-d2/foo' ) ) ; } catch ( e ) { }
@ -292,11 +296,11 @@ function test_deep_symlink_mix(callback) {
[ tmp ( 'node-test-realpath-d1' ) ,
common . tmpDir + '/node-test-realpath-d2' ] ,
[ tmp ( 'node-test-realpath-d2/foo' ) , '../node-test-realpath-f2' ] ,
[ tmp ( 'node-test-realpath-f2' ) , fixture sAbsDir +
[ tmp ( 'node-test-realpath-f2' ) , target sAbsDir +
'/nested-index/one/realpath-c' ] ,
[ fixture sAbsDir + '/nested-index/one/realpath-c' , fixture sAbsDir +
[ target sAbsDir + '/nested-index/one/realpath-c' , target sAbsDir +
'/nested-index/two/realpath-c' ] ,
[ fixture sAbsDir + '/nested-index/two/realpath-c' ,
[ target sAbsDir + '/nested-index/two/realpath-c' ,
common . tmpDir + '/cycles/root.js' ]
] . forEach ( function ( t ) {
try { fs . unlinkSync ( t [ 0 ] ) ; } catch ( e ) { }