rm: change InteractiveMode::Default to InteractiveMode::PromptProtected

Signed-off-by: Stefin <stefin@pm.me>
This commit is contained in:
Stefin 2022-08-27 19:38:10 +05:30
parent ad4eac867f
commit 4c1c9ebf89
2 changed files with 4 additions and 4 deletions

View file

@ -29,7 +29,7 @@ enum InteractiveMode {
Never, Never,
Once, Once,
Always, Always,
Default, PromptProtected,
} }
struct Options { struct Options {
@ -115,7 +115,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
} }
} }
} else { } else {
InteractiveMode::Default InteractiveMode::PromptProtected
} }
}, },
one_fs: matches.contains_id(OPT_ONE_FILE_SYSTEM), one_fs: matches.contains_id(OPT_ONE_FILE_SYSTEM),

View file

@ -364,6 +364,7 @@ fn test_rm_directory_rights_rm1() {
assert!(!at.dir_exists("b/d")); assert!(!at.dir_exists("b/d"));
} }
#[cfg(feature = "chmod")]
#[test] #[test]
fn test_prompt_write_protected_yes() { fn test_prompt_write_protected_yes() {
let scene = TestScenario::new(util_name!()); let scene = TestScenario::new(util_name!());
@ -372,13 +373,13 @@ fn test_prompt_write_protected_yes() {
at.touch(file_1); at.touch(file_1);
#[cfg(feature = "chmod")]
scene.ccmd("chmod").arg("0").arg(file_1).succeeds(); scene.ccmd("chmod").arg("0").arg(file_1).succeeds();
scene.ucmd().arg(file_1).pipe_in("y").succeeds(); scene.ucmd().arg(file_1).pipe_in("y").succeeds();
assert!(!at.file_exists(file_1)); assert!(!at.file_exists(file_1));
} }
#[cfg(feature = "chmod")]
#[test] #[test]
fn test_prompt_write_protected_no() { fn test_prompt_write_protected_no() {
let scene = TestScenario::new(util_name!()); let scene = TestScenario::new(util_name!());
@ -387,7 +388,6 @@ fn test_prompt_write_protected_no() {
at.touch(file_2); at.touch(file_2);
#[cfg(feature = "chmod")]
scene.ccmd("chmod").arg("0").arg(file_2).succeeds(); scene.ccmd("chmod").arg("0").arg(file_2).succeeds();
scene.ucmd().arg(file_2).pipe_in("n").succeeds(); scene.ucmd().arg(file_2).pipe_in("n").succeeds();