Skip to content

Commit

Permalink
rm: add test for "rm .\dir\ -rf" on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
cakebaker authored and sylvestre committed Feb 3, 2024
1 parent 70b54d5 commit d0cfe6e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/by-util/test_rm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,19 @@ fn test_rm_directory_without_flag() {
.stderr_contains(&format!("cannot remove '{dir}': Is a directory"));
}

#[test]
#[cfg(windows)]
// https://github.com/uutils/coreutils/issues/3200
fn test_rm_directory_with_trailing_backslash() {
let (at, mut ucmd) = at_and_ucmd!();
let dir = "dir";

at.mkdir(dir);

ucmd.arg(".\\dir\\").arg("-rf").succeeds();
assert!(!at.dir_exists(dir));
}

#[test]
fn test_rm_verbose() {
let (at, mut ucmd) = at_and_ucmd!();
Expand Down

0 comments on commit d0cfe6e

Please sign in to comment.