@@ -190,21 +190,25 @@ function test_cyclic_link_protection(callback) {
190
190
common . skip ( 'symlink test (no privs)' ) ;
191
191
return runNextTest ( ) ;
192
192
}
193
- const entry = common . tmpDir + '/cycles/realpath-3a' ;
193
+ const entry = path . join ( common . tmpDir , '/cycles/realpath-3a' ) ;
194
194
[
195
195
[ entry , '../cycles/realpath-3b' ] ,
196
- [ common . tmpDir + '/cycles/realpath-3b' , '../cycles/realpath-3c' ] ,
197
- [ common . tmpDir + '/cycles/realpath-3c' , '../cycles/realpath-3a' ]
196
+ [ path . join ( common . tmpDir , '/cycles/realpath-3b' ) , '../cycles/realpath-3c' ] ,
197
+ [ path . join ( common . tmpDir , '/cycles/realpath-3c' ) , '../cycles/realpath-3a' ]
198
198
] . forEach ( function ( t ) {
199
199
try { fs . unlinkSync ( t [ 0 ] ) ; } catch ( e ) { }
200
200
fs . symlinkSync ( t [ 1 ] , t [ 0 ] , 'dir' ) ;
201
201
unlink . push ( t [ 0 ] ) ;
202
202
} ) ;
203
- assert . throws ( function ( ) { fs . realpathSync ( entry ) ; } ) ;
204
- asynctest ( fs . realpath , [ entry ] , callback , function ( err , result ) {
205
- assert . ok ( err && true ) ;
206
- return true ;
207
- } ) ;
203
+ assert . throws ( ( ) => {
204
+ fs . realpathSync ( entry ) ;
205
+ } , / ^ E r r o r : E L O O P : t o o m a n y s y m b o l i c l i n k s e n c o u n t e r e d , s t a t / ) ;
206
+ asynctest (
207
+ fs . realpath , [ entry ] , callback , common . mustCall ( function ( err , result ) {
208
+ assert . strictEqual ( err . path , entry ) ;
209
+ assert . strictEqual ( result , undefined ) ;
210
+ return true ;
211
+ } ) ) ;
208
212
}
209
213
210
214
function test_cyclic_link_overprotection ( callback ) {
0 commit comments