@ -87,7 +87,7 @@ function test_simple_relative_symlink(callback) {
[
[ entry , '../' + common . tmpDirName + '/cycles/root.js' ]
] . forEach ( function ( t ) {
try { fs . unlinkSync ( t [ 0 ] ) ; } catch ( e ) { }
try { fs . unlinkSync ( t [ 0 ] ) ; } catch ( e ) { }
console . log ( 'fs.symlinkSync(%j, %j, %j)' , t [ 1 ] , t [ 0 ] , 'file' ) ;
fs . symlinkSync ( t [ 1 ] , t [ 0 ] , 'file' ) ;
unlink . push ( t [ 0 ] ) ;
@ -113,7 +113,7 @@ function test_simple_absolute_symlink(callback) {
[
[ entry , expected ]
] . forEach ( function ( t ) {
try { fs . unlinkSync ( t [ 0 ] ) ; } catch ( e ) { }
try { fs . unlinkSync ( t [ 0 ] ) ; } catch ( e ) { }
console . error ( 'fs.symlinkSync(%j, %j, %j)' , t [ 1 ] , t [ 0 ] , type ) ;
fs . symlinkSync ( t [ 1 ] , t [ 0 ] , type ) ;
unlink . push ( t [ 0 ] ) ;
@ -138,13 +138,13 @@ function test_deep_relative_file_symlink(callback) {
expected ) ;
const linkPath1 = path . join ( targetsAbsDir ,
'nested-index' , 'one' , 'symlink1.js' ) ;
try { fs . unlinkSync ( linkPath1 ) ; } catch ( e ) { }
try { fs . unlinkSync ( linkPath1 ) ; } catch ( e ) { }
fs . symlinkSync ( linkData1 , linkPath1 , 'file' ) ;
const linkData2 = '../one/symlink1.js' ;
const entry = path . join ( targetsAbsDir ,
'nested-index' , 'two' , 'symlink1-b.js' ) ;
try { fs . unlinkSync ( entry ) ; } catch ( e ) { }
try { fs . unlinkSync ( entry ) ; } catch ( e ) { }
fs . symlinkSync ( linkData2 , entry , 'file' ) ;
unlink . push ( linkPath1 ) ;
unlink . push ( entry ) ;
@ -165,13 +165,13 @@ function test_deep_relative_dir_symlink(callback) {
const path1b = path . join ( targetsAbsDir , 'nested-index' , 'one' ) ;
const linkPath1b = path . join ( path1b , 'symlink1-dir' ) ;
const linkData1b = path . relative ( path1b , expected ) ;
try { fs . unlinkSync ( linkPath1b ) ; } catch ( e ) { }
try { fs . unlinkSync ( linkPath1b ) ; } catch ( e ) { }
fs . symlinkSync ( linkData1b , linkPath1b , 'dir' ) ;
const linkData2b = '../one/symlink1-dir' ;
const entry = path . join ( targetsAbsDir ,
'nested-index' , 'two' , 'symlink12-dir' ) ;
try { fs . unlinkSync ( entry ) ; } catch ( e ) { }
try { fs . unlinkSync ( entry ) ; } catch ( e ) { }
fs . symlinkSync ( linkData2b , entry , 'dir' ) ;
unlink . push ( linkPath1b ) ;
unlink . push ( entry ) ;
@ -195,7 +195,7 @@ function test_cyclic_link_protection(callback) {
[ common . tmpDir + '/cycles/realpath-3b' , '../cycles/realpath-3c' ] ,
[ common . tmpDir + '/cycles/realpath-3c' , '../cycles/realpath-3a' ]
] . forEach ( function ( t ) {
try { fs . unlinkSync ( t [ 0 ] ) ; } catch ( e ) { }
try { fs . unlinkSync ( t [ 0 ] ) ; } catch ( e ) { }
fs . symlinkSync ( t [ 1 ] , t [ 0 ] , 'dir' ) ;
unlink . push ( t [ 0 ] ) ;
} ) ;
@ -218,7 +218,7 @@ function test_cyclic_link_overprotection(callback) {
const link = folder + '/cycles' ;
var testPath = cycles ;
testPath += '/folder/cycles' . repeat ( 10 ) ;
try { fs . unlinkSync ( link ) ; } catch ( ex ) { }
try { fs . unlinkSync ( link ) ; } catch ( ex ) { }
fs . symlinkSync ( cycles , link , 'dir' ) ;
unlink . push ( link ) ;
assertEqualPath ( fs . realpathSync ( testPath ) , path . resolve ( expected ) ) ;
@ -246,7 +246,7 @@ function test_relative_input_cwd(callback) {
] . forEach ( function ( t ) {
const fn = t [ 0 ] ;
console . error ( 'fn=%j' , fn ) ;
try { fs . unlinkSync ( fn ) ; } catch ( e ) { }
try { fs . unlinkSync ( fn ) ; } catch ( e ) { }
const b = path . basename ( t [ 1 ] ) ;
const type = ( b === 'root.js' ? 'file' : 'dir' ) ;
console . log ( 'fs.symlinkSync(%j, %j, %j)' , t [ 1 ] , fn , type ) ;
@ -363,7 +363,7 @@ function test_up_multiple(cb) {
[ 'a/b' ,
'a'
] . forEach ( function ( folder ) {
try { fs . rmdirSync ( tmp ( folder ) ) ; } catch ( ex ) { }
try { fs . rmdirSync ( tmp ( folder ) ) ; } catch ( ex ) { }
} ) ;
}
function setup ( ) {
@ -420,14 +420,14 @@ function test_abs_with_kids(cb) {
[ '/a/b/c/x.txt' ,
'/a/link'
] . forEach ( function ( file ) {
try { fs . unlinkSync ( root + file ) ; } catch ( ex ) { }
try { fs . unlinkSync ( root + file ) ; } catch ( ex ) { }
} ) ;
[ '/a/b/c' ,
'/a/b' ,
'/a' ,
''
] . forEach ( function ( folder ) {
try { fs . rmdirSync ( root + folder ) ; } catch ( ex ) { }
try { fs . rmdirSync ( root + folder ) ; } catch ( ex ) { }
} ) ;
}
function setup ( ) {