File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change 1- // Copyright 2020-2023 Martin Pool.
1+ // Copyright 2020-2025 Martin Pool.
22
33// This program is free software; you can redistribute it and/or modify
44// it under the terms of the GNU General Public License as published by
@@ -294,6 +294,20 @@ mod test {
294294
295295 temp. close ( ) . unwrap ( ) ;
296296 }
297+
298+ #[ cfg( unix) ]
299+ #[ test]
300+ fn list_dir_skips_symlinks ( ) {
301+ // Archives aren't expected to contain symlinks and so list_dir just skips them.
302+
303+ let transport = Transport :: temp ( ) ;
304+ let dir = transport. local_path ( ) . unwrap ( ) ;
305+ std:: os:: unix:: fs:: symlink ( "foo" , dir. join ( "alink" ) ) . unwrap ( ) ;
306+
307+ let list_dir = transport. list_dir ( "." ) . unwrap ( ) ;
308+ assert_eq ! ( list_dir. files, [ "" ; 0 ] ) ;
309+ assert_eq ! ( list_dir. dirs, [ "" ; 0 ] ) ;
310+ }
297311
298312 #[ test]
299313 fn write_file ( ) {
You can’t perform that action at this time.
0 commit comments