File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -505,9 +505,30 @@ fn test_cp_arg_interactive_update() {
505
505
at. touch ( "a" ) ;
506
506
at. touch ( "b" ) ;
507
507
ucmd. args ( & [ "-i" , "-u" , "a" , "b" ] )
508
- . pipe_in ( "N \n " )
508
+ . pipe_in ( "" )
509
509
. succeeds ( )
510
510
. no_stdout ( ) ;
511
+ let ( at, mut ucmd) = at_and_ucmd ! ( ) ;
512
+ at. touch ( "a" ) ;
513
+ at. touch ( "b" ) ;
514
+ ucmd. args ( & [ "-i" , "-u" , "a" , "b" ] ) . succeeds ( ) . no_stdout ( ) ;
515
+ }
516
+
517
+ #[ test]
518
+ #[ cfg( not( any( target_os = "android" , target_os = "freebsd" ) ) ) ]
519
+ #[ ignore = "known issue #6019" ]
520
+ fn test_cp_arg_interactive_update_newer ( ) {
521
+ // -u -i *WILL* show the prompt to validate the override.
522
+ // Therefore, the error code depends on the prompt response.
523
+ let ( at, mut ucmd) = at_and_ucmd ! ( ) ;
524
+ at. touch ( "b" ) ;
525
+ at. touch ( "a" ) ;
526
+ ucmd. args ( & [ "-i" , "-u" , "a" , "b" ] )
527
+ . pipe_in ( "N\n " )
528
+ . fails ( )
529
+ . code_is ( 1 )
530
+ . no_stdout ( )
531
+ . stderr_is ( "cp: overwrite 'b'? " ) ;
511
532
}
512
533
513
534
#[ test]
You can’t perform that action at this time.
0 commit comments