mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
rm: add tests for --interactive with empty when
This commit is contained in:
parent
78909fdd39
commit
eeb3341101
1 changed files with 20 additions and 0 deletions
|
@ -361,6 +361,26 @@ fn test_rm_interactive_never() {
|
|||
assert!(!at.file_exists(file_2));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rm_interactive_missing_value() {
|
||||
// `--interactive` is equivalent to `--interactive=always` or `-i`
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
|
||||
let file1 = "test_rm_interactive_missing_value_file1";
|
||||
let file2 = "test_rm_interactive_missing_value_file2";
|
||||
|
||||
at.touch(file1);
|
||||
at.touch(file2);
|
||||
|
||||
ucmd.arg("--interactive")
|
||||
.arg(file1)
|
||||
.arg(file2)
|
||||
.pipe_in("y\ny")
|
||||
.succeeds();
|
||||
|
||||
assert!(!at.file_exists(file1));
|
||||
assert!(!at.file_exists(file2));
|
||||
}
|
||||
#[test]
|
||||
fn test_rm_descend_directory() {
|
||||
// This test descends into each directory and deletes the files and folders inside of them
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue