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:
commit
bbef777c8c
2 changed files with 46 additions and 15 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue