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

cp: override args

These arguments should not have been in conflict with each other, but silently override each other.
This commit is contained in:
Terts Diepraam 2022-01-31 12:54:26 +01:00
parent b8a3795d95
commit 9aca050e4a
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");
}
}