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

Merge branch 'main' into fix-5327

This commit is contained in:
tommady 2023-10-04 16:06:48 +08:00 committed by GitHub
commit 879b4f363d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
37 changed files with 1255 additions and 631 deletions

View file

@ -483,7 +483,8 @@ fn test_cp_arg_interactive_verbose() {
ucmd.args(&["-vi", "a", "b"])
.pipe_in("N\n")
.fails()
.stdout_is("skipped 'b'\n");
.stderr_is("cp: overwrite 'b'? ")
.no_stdout();
}
#[test]
@ -494,7 +495,8 @@ fn test_cp_arg_interactive_verbose_clobber() {
at.touch("b");
ucmd.args(&["-vin", "a", "b"])
.fails()
.stdout_is("skipped 'b'\n");
.stderr_is("cp: not replacing 'b'\n")
.no_stdout();
}
#[test]
@ -3466,3 +3468,19 @@ fn test_cp_only_source_no_target() {
panic!("Failure: stderr was \n{stderr_str}");
}
}
#[test]
fn test_cp_dest_no_permissions() {
let ts = TestScenario::new(util_name!());
let at = &ts.fixtures;
at.touch("valid.txt");
at.touch("invalid_perms.txt");
at.set_readonly("invalid_perms.txt");
ts.ucmd()
.args(&["valid.txt", "invalid_perms.txt"])
.fails()
.stderr_contains("invalid_perms.txt")
.stderr_contains("denied");
}