chore(tvix/castore/path): drop now-duplicate tests

Since PathBuf doesn't have inherent methods anymore, these just forward
to Path itself.

Change-Id: I30f44adc9994337c367bad985ada0e8fcb98dd6a
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11570
Tested-by: BuildkiteCI
Reviewed-by: flokli <flokli@flokli.de>
This commit is contained in:
edef 2024-05-01 12:10:07 +00:00
parent 465370c11f
commit 4b3223a621

View file

@ -210,11 +210,7 @@ mod test {
#[case("foo2/bar2", "foo2")]
#[case("foo/bar/baz", "foo/bar")]
pub fn parent(#[case] p: PathBuf, #[case] exp_parent: PathBuf) {
assert_eq!(Some(exp_parent.as_ref()), p.parent());
// same for Path
let p = p.as_ref();
assert_eq!(Some(exp_parent.as_ref()), p.parent());
assert_eq!(Some(&*exp_parent), p.parent());
}
#[rstest]
@ -232,11 +228,6 @@ mod test {
#[case("a", "b", "a/b")]
pub fn join(#[case] p: PathBuf, #[case] name: &str, #[case] exp_p: PathBuf) {
assert_eq!(exp_p, p.join(name.as_bytes()).expect("join failed"));
// same for Path
assert_eq!(
exp_p,
p.as_ref().join(name.as_bytes()).expect("join failed")
);
}
#[rstest]
@ -249,11 +240,6 @@ mod test {
pub fn join_fail(#[case] p: PathBuf, #[case] name: &str) {
p.join(name.as_bytes())
.expect_err("join succeeded unexpectedly");
// same for Path
p.as_ref()
.join(name.as_bytes())
.expect_err("join succeeded unexpectedly");
}
#[rstest]
@ -268,14 +254,5 @@ mod test {
.map(|x| x.to_str().unwrap())
.collect::<Vec<_>>()
);
// same for Path
let p = p.as_ref();
assert_eq!(
exp_components,
p.components()
.map(|x| x.to_str().unwrap())
.collect::<Vec<_>>()
);
}
}