mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
mv: make sure it continues when hiting an error
This commit is contained in:
parent
9c7fd5e8cb
commit
c94773f522
2 changed files with 28 additions and 1 deletions
|
@ -1495,6 +1495,32 @@ fn test_mv_seen_file() {
|
|||
assert!(!at.plus("a").join("f").exists());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mv_seen_multiple_files_to_directory() {
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let at = &ts.fixtures;
|
||||
|
||||
at.mkdir("a");
|
||||
at.mkdir("b");
|
||||
at.mkdir("c");
|
||||
at.write("a/f", "a");
|
||||
at.write("b/f", "b");
|
||||
at.write("b/g", "g");
|
||||
|
||||
ts.ucmd()
|
||||
.arg("a/f")
|
||||
.arg("b/f")
|
||||
.arg("b/g")
|
||||
.arg("c")
|
||||
.fails()
|
||||
.stderr_contains("will not overwrite just-created 'c/f' with 'b/f'");
|
||||
assert!(!at.plus("a").join("f").exists());
|
||||
assert!(at.plus("b").join("f").exists());
|
||||
assert!(!at.plus("b").join("g").exists());
|
||||
assert!(at.plus("c").join("f").exists());
|
||||
assert!(at.plus("c").join("g").exists());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mv_dir_into_file_where_both_are_files() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue