mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
mv: cleanup the code
This commit is contained in:
parent
2981eb5112
commit
a4bf852207
4 changed files with 123 additions and 77 deletions
|
@ -208,6 +208,25 @@ fn test_mv_custom_backup_suffix() {
|
|||
assert!(at.file_exists(&format!("{}{}", file_b, suffix)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mv_custom_backup_suffix_via_env() {
|
||||
let (at, mut ucmd) = at_and_ucmd();
|
||||
let file_a = "test_mv_custom_backup_suffix_file_a";
|
||||
let file_b = "test_mv_custom_backup_suffix_file_b";
|
||||
let suffix = "super-suffix-of-the-century";
|
||||
at.touch(file_a);
|
||||
at.touch(file_b);
|
||||
ucmd.arg("-b")
|
||||
.env("SIMPLE_BACKUP_SUFFIX", suffix)
|
||||
.arg(file_a)
|
||||
.arg(file_b)
|
||||
.succeeds().no_stderr();
|
||||
|
||||
assert!(!at.file_exists(file_a));
|
||||
assert!(at.file_exists(file_b));
|
||||
assert!(at.file_exists(&format!("{}{}", file_b, suffix)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_mv_backup_numbering() {
|
||||
let (at, mut ucmd) = at_and_ucmd();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue