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

cp: Duplicate source error message specify the type of file.

This commit is contained in:
mhead 2024-10-31 11:49:29 +05:30
parent 4d5bf4205f
commit ff586b47d4
2 changed files with 22 additions and 2 deletions

View file

@ -120,7 +120,19 @@ fn test_cp_duplicate_files() {
));
assert_eq!(at.read(TEST_COPY_TO_FOLDER_FILE), "Hello, World!\n");
}
#[test]
fn test_cp_duplicate_folder() {
let (at, mut ucmd) = at_and_ucmd!();
ucmd.arg("-r")
.arg(TEST_COPY_FROM_FOLDER)
.arg(TEST_COPY_FROM_FOLDER)
.arg(TEST_COPY_TO_FOLDER)
.succeeds()
.stderr_contains(format!(
"source directory '{TEST_COPY_FROM_FOLDER}' specified more than once"
));
assert!(at.dir_exists(format!("{TEST_COPY_TO_FOLDER}/{TEST_COPY_FROM_FOLDER}").as_str()));
}
#[test]
fn test_cp_duplicate_files_normalized_path() {
let (at, mut ucmd) = at_and_ucmd!();