mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
cp: fix cp -rT dir dir2 leads to different result than with GNU cp (#5467)
* add a test case test_cp_treat_dest_as_a_normal_file * fix 5457 * cp: fix comment --------- Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
This commit is contained in:
parent
72193f8adc
commit
a4775d288b
2 changed files with 31 additions and 3 deletions
|
@ -230,6 +230,22 @@ fn test_cp_arg_no_target_directory() {
|
|||
.stderr_contains("cannot overwrite directory");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cp_arg_no_target_directory_with_recursive() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
|
||||
at.mkdir("dir");
|
||||
at.mkdir("dir2");
|
||||
at.touch("dir/a");
|
||||
at.touch("dir/b");
|
||||
|
||||
ucmd.arg("-rT").arg("dir").arg("dir2").succeeds();
|
||||
|
||||
assert!(at.plus("dir2").join("a").exists());
|
||||
assert!(at.plus("dir2").join("b").exists());
|
||||
assert!(!at.plus("dir2").join("dir").exists());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cp_target_directory_is_file() {
|
||||
new_ucmd!()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue