File tree Expand file tree Collapse file tree 1 file changed +15
-2
lines changed
Expand file tree Collapse file tree 1 file changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -826,16 +826,29 @@ fn test_recursive_symlink_loop() {
826826}
827827
828828#[ cfg( not( windows) ) ]
829- #[ ignore = "from GNU test file tests/rm/empty-inacc.sh" ]
830829#[ test]
831- fn test_inaccesible_dir ( ) {
830+ fn test_inaccessible_dir ( ) {
832831 let ( at, mut ucmd) = at_and_ucmd ! ( ) ;
833832 at. mkdir ( "dir" ) ;
834833 at. set_mode ( "dir" , 0o0333 ) ;
835834 ucmd. args ( & [ "-d" , "dir" ] ) . succeeds ( ) . no_output ( ) ;
836835 assert ! ( !at. dir_exists( "dir" ) ) ;
837836}
838837
838+ #[ cfg( not( windows) ) ]
839+ #[ test]
840+ fn test_inaccessible_dir_nonempty ( ) {
841+ let ( at, mut ucmd) = at_and_ucmd ! ( ) ;
842+ at. mkdir ( "dir" ) ;
843+ at. touch ( "dir/f" ) ;
844+ at. set_mode ( "dir" , 0o0333 ) ;
845+ ucmd. args ( & [ "-d" , "dir" ] )
846+ . fails ( )
847+ . stderr_only ( "rm: cannot remove 'dir': Directory not empty\n " ) ;
848+ assert ! ( at. file_exists( "dir/f" ) ) ;
849+ assert ! ( at. dir_exists( "dir" ) ) ;
850+ }
851+
839852#[ cfg( not( windows) ) ]
840853#[ test]
841854fn test_inaccessible_dir_recursive ( ) {
You can’t perform that action at this time.
0 commit comments