mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge branch 'main' into cp-lb
This commit is contained in:
commit
6bf575ad56
192 changed files with 6336 additions and 3125 deletions
|
@ -385,6 +385,24 @@ fn test_cp_arg_suffix() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cp_arg_suffix_hyphen_value() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
|
||||
ucmd.arg(TEST_HELLO_WORLD_SOURCE)
|
||||
.arg("-b")
|
||||
.arg("--suffix")
|
||||
.arg("-v")
|
||||
.arg(TEST_HOW_ARE_YOU_SOURCE)
|
||||
.succeeds();
|
||||
|
||||
assert_eq!(at.read(TEST_HOW_ARE_YOU_SOURCE), "Hello, World!\n");
|
||||
assert_eq!(
|
||||
at.read(&*format!("{}-v", TEST_HOW_ARE_YOU_SOURCE)),
|
||||
"How are you?\n"
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_cp_custom_backup_suffix_via_env() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
|
@ -1458,3 +1476,13 @@ fn test_cp_link_backup() {
|
|||
assert!(at.file_exists("file2~"));
|
||||
assert_eq!(at.read("file2"), "Hello, World!\n");
|
||||
}
|
||||
|
||||
#[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