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

Merge pull request #6837 from matrixhead/dup-source

mv: gnu test `dup-src` compatibilty
This commit is contained in:
Daniel Hofstetter 2024-11-01 09:34:43 +01:00 committed by GitHub
commit 27fc9f614f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 0 deletions

View file

@ -446,6 +446,11 @@ fn move_files_into_dir(files: &[PathBuf], target_dir: &Path, options: &Options)
}; };
for sourcepath in files { for sourcepath in files {
if !sourcepath.exists() {
show!(MvError::NoSuchFile(sourcepath.quote().to_string()));
continue;
}
if let Some(ref pb) = count_progress { if let Some(ref pb) = count_progress {
pb.set_message(sourcepath.to_string_lossy().to_string()); pb.set_message(sourcepath.to_string_lossy().to_string());
} }

View file

@ -1717,3 +1717,18 @@ mod inter_partition_copying {
.stderr_contains("Permission denied"); .stderr_contains("Permission denied");
} }
} }
#[test]
fn test_mv_error_msg_with_multiple_sources_that_does_not_exist() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
at.mkdir("d");
scene
.ucmd()
.arg("a")
.arg("b/")
.arg("d")
.fails()
.stderr_contains("mv: cannot stat 'a': No such file or directory")
.stderr_contains("mv: cannot stat 'b/': No such file or directory");
}