From 4b3223a621c37ddb55d1b7054cf4ddb120c22de5 Mon Sep 17 00:00:00 2001 From: edef Date: Wed, 1 May 2024 12:10:07 +0000 Subject: 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 --- tvix/castore/src/path.rs | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) (limited to 'tvix/castore') diff --git a/tvix/castore/src/path.rs b/tvix/castore/src/path.rs index 3577ea80a4a9..2da1413c4836 100644 --- a/tvix/castore/src/path.rs +++ b/tvix/castore/src/path.rs @@ -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::>() ); - - // same for Path - let p = p.as_ref(); - assert_eq!( - exp_components, - p.components() - .map(|x| x.to_str().unwrap()) - .collect::>() - ); } } -- cgit 1.4.1