1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

cp: make test for interactive mode more specific

This commit is contained in:
Jeffrey Finkelstein 2022-10-10 10:41:43 -04:00
parent bb27734f6a
commit cee6c25cc4

View file

@ -217,15 +217,18 @@ fn test_cp_target_directory_is_file() {
#[test]
fn test_cp_arg_interactive() {
new_ucmd!()
.arg(TEST_HELLO_WORLD_SOURCE)
.arg(TEST_HOW_ARE_YOU_SOURCE)
.arg("-i")
let (at, mut ucmd) = at_and_ucmd!();
at.touch("a");
at.touch("b");
// TODO The prompt in GNU cp is different, and it doesn't have the
// response either.
//
// See <https://github.com/uutils/coreutils/issues/4023>.
ucmd.args(&["-i", "a", "b"])
.pipe_in("N\n")
.succeeds()
.no_stdout()
.stderr_contains(format!("overwrite '{}'?", TEST_HOW_ARE_YOU_SOURCE))
.stderr_contains("Not overwriting");
.stderr_is("cp: overwrite 'b'? [y/N]: cp: Not overwriting 'b' at user request\n");
}
#[test]