1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-16 19:56:17 +00:00

Merge pull request #2998 from tertsdiepraam/cp-override-args

`cp`: override args instead of having them conflict
This commit is contained in:
Sylvestre Ledru 2022-02-28 14:47:53 +01:00 committed by GitHub
commit bbef777c8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 46 additions and 15 deletions

View file

@ -1517,3 +1517,28 @@ fn test_cp_dir_vs_file() {
.fails()
.stderr_only("cp: cannot overwrite non-directory with directory");
}
#[test]
fn test_cp_overriding_arguments() {
let s = TestScenario::new(util_name!());
s.fixtures.touch("file1");
for (arg1, arg2) in &[
#[cfg(not(windows))]
("--remove-destination", "--force"),
#[cfg(not(windows))]
("--force", "--remove-destination"),
("--interactive", "--no-clobber"),
("--link", "--symbolic-link"),
("--symbolic-link", "--link"),
("--dereference", "--no-dereference"),
("--no-dereference", "--dereference"),
] {
s.ucmd()
.arg(arg1)
.arg(arg2)
.arg("file1")
.arg("file2")
.succeeds();
s.fixtures.remove("file2");
}
}