Skip to content

Commit

Permalink
cp: fix flaky test test_cp_arg_interactive_update, document adjacent bug
Browse files Browse the repository at this point in the history
  • Loading branch information
BenWiederhake committed Feb 25, 2024
1 parent d7a09c0 commit 689c563
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion tests/by-util/test_cp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -505,9 +505,30 @@ fn test_cp_arg_interactive_update() {
at.touch("a");
at.touch("b");
ucmd.args(&["-i", "-u", "a", "b"])
.pipe_in("N\n")
.pipe_in("")
.succeeds()
.no_stdout();
let (at, mut ucmd) = at_and_ucmd!();
at.touch("a");
at.touch("b");
ucmd.args(&["-i", "-u", "a", "b"]).succeeds().no_stdout();
}

#[test]
#[cfg(not(any(target_os = "android", target_os = "freebsd")))]
#[ignore = "known issue #6019"]
fn test_cp_arg_interactive_update_newer() {
// -u -i *WILL* show the prompt to validate the override.
// Therefore, the error code will be 0
let (at, mut ucmd) = at_and_ucmd!();
at.touch("b");
at.touch("a");
ucmd.args(&["-i", "-u", "a", "b"])
.pipe_in("N\n")
.fails()
.code_is(1)
.no_stdout()
.stderr_is("cp: overwrite 'b'? ");
}

#[test]
Expand Down

0 comments on commit 689c563

Please sign in to comment.