about summary refs log tree commit diff
diff options
context:
space:
mode:
authoredef <edef@edef.eu>2024-05-01T12·10+0000
committeredef <edef@edef.eu>2024-05-01T13·40+0000
commit4b3223a621c37ddb55d1b7054cf4ddb120c22de5 (patch)
treec242b0d7960ab6dcda24ce0a7b1e0d7289150882
parent465370c11f82dbe98ce0702708a2e6060b62950e (diff)
chore(tvix/castore/path): drop now-duplicate tests r/8055
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>
-rw-r--r--tvix/castore/src/path.rs25
1 files changed, 1 insertions, 24 deletions
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::<Vec<_>>()
         );
-
-        // same for Path
-        let p = p.as_ref();
-        assert_eq!(
-            exp_components,
-            p.components()
-                .map(|x| x.to_str().unwrap())
-                .collect::<Vec<_>>()
-        );
     }
 }