mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
rm: Remove invalid symlinks
Checking with file.exists() was not good for this purpose as Path::exists() returns false for invalid symlinks.
This commit is contained in:
parent
5f1cb07df8
commit
416c2b7f89
2 changed files with 21 additions and 13 deletions
|
@ -148,3 +148,13 @@ fn test_rm_dir_symlink() {
|
|||
|
||||
ucmd.arg(link).succeeds();
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_rm_invalid_symlink() {
|
||||
let (at, mut ucmd) = at_and_ucmd!();
|
||||
let link = "test_rm_invalid_symlink";
|
||||
|
||||
at.symlink(link, link);
|
||||
|
||||
ucmd.arg(link).succeeds();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue