@@ -190,21 +190,25 @@ function test_cyclic_link_protection(callback) {
190190 common . skip ( 'symlink test (no privs)' ) ;
191191 return runNextTest ( ) ;
192192 }
193- const entry = common . tmpDir + '/cycles/realpath-3a' ;
193+ const entry = path . join ( common . tmpDir , '/cycles/realpath-3a' ) ;
194194 [
195195 [ 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' ]
198198 ] . forEach ( function ( t ) {
199199 try { fs . unlinkSync ( t [ 0 ] ) ; } catch ( e ) { }
200200 fs . symlinkSync ( t [ 1 ] , t [ 0 ] , 'dir' ) ;
201201 unlink . push ( t [ 0 ] ) ;
202202 } ) ;
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+ } ) ) ;
208212}
209213
210214function test_cyclic_link_overprotection ( callback ) {
0 commit comments