1
Fork 0
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:
John Shin 2023-05-22 21:23:44 -07:00
parent 78909fdd39
commit eeb3341101

View file

@ -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