mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
cp: don't fail when --backup=numbered is passed
This commit is contained in:
parent
837640bc02
commit
06c98fbdd3
2 changed files with 16 additions and 3 deletions
|
@ -3562,7 +3562,8 @@ fn test_cp_attributes_only() {
|
|||
|
||||
#[test]
|
||||
fn test_cp_seen_file() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = &ts.fixtures;
|
||||
|
||||
at.mkdir("a");
|
||||
at.mkdir("b");
|
||||
|
@ -3570,11 +3571,21 @@ fn test_cp_seen_file() {
|
|||
at.write("a/f", "a");
|
||||
at.write("b/f", "b");
|
||||
|
||||
ucmd.arg("a/f")
|
||||
ts.ucmd()
|
||||
.arg("a/f")
|
||||
.arg("b/f")
|
||||
.arg("c")
|
||||
.fails()
|
||||
.stderr_contains("will not overwrite just-created 'c/f' with 'b/f'");
|
||||
|
||||
assert!(at.plus("c").join("f").exists());
|
||||
|
||||
ts.ucmd()
|
||||
.arg("--backup=numbered")
|
||||
.arg("a/f")
|
||||
.arg("b/f")
|
||||
.arg("c")
|
||||
.succeeds();
|
||||
assert!(at.plus("c").join("f").exists());
|
||||
assert!(at.plus("c").join("f.~1~").exists());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue