mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
Add tests for silently accepting presume-input-tty
Signed-off-by: Hanif Bin Ariffin <hanif.ariffin.4326@gmail.com>
This commit is contained in:
@@ -314,3 +314,39 @@ fn test_rm_verbose_slash() {
|
||||
assert!(!at.dir_exists(dir));
|
||||
assert!(!at.file_exists(file_a));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rm_silently_accepts_presume_input_tty1() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
let file_1 = "test_rm_silently_accepts_presume_input_tty1";
|
||||
|
||||
at.touch(file_1);
|
||||
|
||||
ucmd.arg("--presume-input-tty").arg(file_1).succeeds();
|
||||
|
||||
assert!(!at.file_exists(file_1));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rm_silently_accepts_presume_input_tty2() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
let file_2 = "test_rm_silently_accepts_presume_input_tty2";
|
||||
|
||||
at.touch(file_2);
|
||||
|
||||
ucmd.arg("---presume-input-tty").arg(file_2).succeeds();
|
||||
|
||||
assert!(!at.file_exists(file_2));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rm_silently_accepts_presume_input_tty3() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
let file_3 = "test_rm_silently_accepts_presume_input_tty3";
|
||||
|
||||
at.touch(file_3);
|
||||
|
||||
ucmd.arg("----presume-input-tty").arg(file_3).succeeds();
|
||||
|
||||
assert!(!at.file_exists(file_3));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user