mirror of
https://github.com/uutils/coreutils
synced 2024-12-13 14:52:41 +00:00
rm: change InteractiveMode::Default to InteractiveMode::PromptProtected
Signed-off-by: Stefin <stefin@pm.me>
This commit is contained in:
parent
ad4eac867f
commit
4c1c9ebf89
2 changed files with 4 additions and 4 deletions
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue