mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
rm: change InteractiveMode::Default to InteractiveMode::PromptProtected
Signed-off-by: Stefin <stefin@pm.me>
This commit is contained in:
+2
-2
@@ -29,7 +29,7 @@ enum InteractiveMode {
|
||||
Never,
|
||||
Once,
|
||||
Always,
|
||||
Default,
|
||||
PromptProtected,
|
||||
}
|
||||
|
||||
struct Options {
|
||||
@@ -115,7 +115,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
InteractiveMode::Default
|
||||
InteractiveMode::PromptProtected
|
||||
}
|
||||
},
|
||||
one_fs: matches.contains_id(OPT_ONE_FILE_SYSTEM),
|
||||
|
||||
@@ -364,6 +364,7 @@ fn test_rm_directory_rights_rm1() {
|
||||
assert!(!at.dir_exists("b/d"));
|
||||
}
|
||||
|
||||
#[cfg(feature = "chmod")]
|
||||
#[test]
|
||||
fn test_prompt_write_protected_yes() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
@@ -372,13 +373,13 @@ fn test_prompt_write_protected_yes() {
|
||||
|
||||
at.touch(file_1);
|
||||
|
||||
#[cfg(feature = "chmod")]
|
||||
scene.ccmd("chmod").arg("0").arg(file_1).succeeds();
|
||||
|
||||
scene.ucmd().arg(file_1).pipe_in("y").succeeds();
|
||||
assert!(!at.file_exists(file_1));
|
||||
}
|
||||
|
||||
#[cfg(feature = "chmod")]
|
||||
#[test]
|
||||
fn test_prompt_write_protected_no() {
|
||||
let scene = TestScenario::new(util_name!());
|
||||
@@ -387,7 +388,6 @@ fn test_prompt_write_protected_no() {
|
||||
|
||||
at.touch(file_2);
|
||||
|
||||
#[cfg(feature = "chmod")]
|
||||
scene.ccmd("chmod").arg("0").arg(file_2).succeeds();
|
||||
|
||||
scene.ucmd().arg(file_2).pipe_in("n").succeeds();
|
||||
|
||||
Reference in New Issue
Block a user