ericcornelissen/rust-rm

test `test_disallow_root::non_root` not working on Windows

Closed this issue · 0 comments

Test Improvement

Summary

The test:

rust-rm/src/main.rs

Lines 3386 to 3396 in 20a3d57

#[proptest]
#[cfg_attr(windows, ignore = "TODO: investigate errors on Windows")]
fn non_root(item: walk::Item) {
if let Ok(entry) = item.inner.as_ref() {
prop_assume!(entry.path() != Path::new("/"));
prop_assume!(!entry.path().as_os_str().is_empty());
}
let out = disallow_root(item.clone());
prop_assert_eq!(out, item);
}

is currently flaky on Windows systems, failing on a proptest-regressions' shrinked value of:

... # shrinks to item = Item { inner: Ok(Entry { kind: Dir, path: "a" }), skip_reason: None, visited: false }

As of writing it is unclear whether this is because the test is faulty or because the implementation is faulty.

Notes

This test was originally mentioned in #1 as a test failing due to symlinks but this was incorrect. Hence, this issue was created after #1 was closed.