mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge pull request #3044 from water-ghosts/cp-dir-vs-file
cp: Fail when copying a directory to a file
This commit is contained in:
commit
1ac45c9961
2 changed files with 13 additions and 1 deletions
|
@ -1462,3 +1462,12 @@ fn test_cp_archive_on_nonexistent_file() {
|
|||
"cp: cannot stat 'nonexistent_file.txt': No such file or directory (os error 2)",
|
||||
);
|
||||
}
|
||||
#[test]
|
||||
fn test_cp_dir_vs_file() {
|
||||
new_ucmd!()
|
||||
.arg("-R")
|
||||
.arg(TEST_COPY_FROM_FOLDER)
|
||||
.arg(TEST_EXISTING_FILE)
|
||||
.fails()
|
||||
.stderr_only("cp: cannot overwrite non-directory with directory");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue