mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-27 19:17:43 +00:00
cp: copy dir if source path ends with dot (#7874)
This commit is contained in:
parent
f49e120877
commit
cd3c921d1e
2 changed files with 19 additions and 48 deletions
|
@ -291,6 +291,24 @@ fn test_cp_recurse_several() {
|
|||
assert_eq!(at.read(TEST_COPY_TO_FOLDER_NEW_FILE), "Hello, World!\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cp_recurse_source_path_ends_with_slash_dot() {
|
||||
let source_dir = "source_dir";
|
||||
let target_dir = "target_dir";
|
||||
let file = "file";
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
|
||||
at.mkdir(source_dir);
|
||||
at.touch(format!("{source_dir}/{file}"));
|
||||
|
||||
ucmd.arg("-r")
|
||||
.arg(format!("{source_dir}/."))
|
||||
.arg(target_dir)
|
||||
.succeeds()
|
||||
.no_output();
|
||||
assert!(at.file_exists(format!("{target_dir}/{file}")));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cp_with_dirs_t() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue