1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-15 11:36:16 +00:00

Merge pull request #5403 from sylvestre/rm

rm: In some cases, remove_dir is doing a better job than remove_dir_all
This commit is contained in:
Daniel Hofstetter 2023-10-16 09:35:44 +02:00 committed by GitHub
commit 541ac6a813
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 9 deletions

View file

@ -647,6 +647,21 @@ fn test_prompt_write_protected_no() {
assert!(at.file_exists(file_2));
}
#[cfg(feature = "chmod")]
#[test]
fn test_remove_inaccessible_dir() {
let scene = TestScenario::new(util_name!());
let at = &scene.fixtures;
let dir_1 = "test_rm_protected";
at.mkdir(dir_1);
scene.ccmd("chmod").arg("0").arg(dir_1).succeeds();
scene.ucmd().arg("-rf").arg(dir_1).succeeds();
assert!(!at.dir_exists(dir_1));
}
#[test]
#[cfg(not(windows))]
fn test_fifo_removal() {