1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #7325 from jfinkels/rm-prompt-message-inaccessible

rm: correct prompt for removing inaccessible dir
This commit is contained in:
Daniel Hofstetter 2025-02-19 10:36:30 +01:00 committed by GitHub
commit 99d4fbdd85
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 44 additions and 20 deletions

View file

@ -874,6 +874,19 @@ fn test_inaccessible_dir_nonempty() {
assert!(at.dir_exists("dir"));
}
#[cfg(not(windows))]
#[test]
fn test_inaccessible_dir_interactive() {
let (at, mut ucmd) = at_and_ucmd!();
at.mkdir("dir");
at.set_mode("dir", 0);
ucmd.args(&["-i", "-d", "dir"])
.pipe_in("y\n")
.succeeds()
.stderr_only("rm: attempt removal of inaccessible directory 'dir'? ");
assert!(!at.dir_exists("dir"));
}
#[cfg(not(windows))]
#[test]
fn test_inaccessible_dir_recursive() {