diff --git a/tests/by-util/test_rm.rs b/tests/by-util/test_rm.rs index a5c342ffe..85d96d2ee 100644 --- a/tests/by-util/test_rm.rs +++ b/tests/by-util/test_rm.rs @@ -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