1
Fork 0
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:
Shinichiro Hamaji 2017-04-09 01:03:16 +09:00
parent 5f1cb07df8
commit 416c2b7f89
2 changed files with 21 additions and 13 deletions

View file

@ -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();
}