mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
cp: make test for interactive mode more specific
This commit is contained in:
parent
bb27734f6a
commit
cee6c25cc4
1 changed files with 9 additions and 6 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue