mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
uucore: allow backup suffix with hyphen value
This commit is contained in:
parent
dfc661e8b5
commit
184b65df20
5 changed files with 101 additions and 0 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!();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue