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

cp: -i prompts in the right place

Should fix tests/cp/cp-i.sh
This commit is contained in:
Sylvestre Ledru 2023-06-01 00:23:34 +02:00
parent 4eb1e847e9
commit 20ce7accf2
2 changed files with 43 additions and 8 deletions

View file

@ -456,6 +456,29 @@ fn test_cp_arg_interactive_update() {
.no_stdout();
}
#[test]
#[cfg(not(target_os = "android"))]
fn test_cp_arg_interactive_verbose() {
let (at, mut ucmd) = at_and_ucmd!();
at.touch("a");
at.touch("b");
ucmd.args(&["-vi", "a", "b"])
.pipe_in("N\n")
.fails()
.stdout_is("skipped 'b'\n");
}
#[test]
#[cfg(not(target_os = "android"))]
fn test_cp_arg_interactive_verbose_clobber() {
let (at, mut ucmd) = at_and_ucmd!();
at.touch("a");
at.touch("b");
ucmd.args(&["-vin", "a", "b"])
.fails()
.stdout_is("skipped 'b'\n");
}
#[test]
#[cfg(target_os = "linux")]
fn test_cp_arg_link() {
@ -487,7 +510,8 @@ fn test_cp_arg_no_clobber() {
ucmd.arg(TEST_HELLO_WORLD_SOURCE)
.arg(TEST_HOW_ARE_YOU_SOURCE)
.arg("--no-clobber")
.fails();
.fails()
.stderr_contains("not replacing");
assert_eq!(at.read(TEST_HOW_ARE_YOU_SOURCE), "How are you?\n");
}