about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-04-06T20·41+0300
committerflokli <flokli@flokli.de>2024-04-07T14·51+0000
commit71fb99a2650280e6ec7c7d2543908c5a73d1b593 (patch)
tree8e30149b5f795ecff590a1e4bb0c22162910d0d4
parentc7c66abd85cb78664cbe6cbe97f879a3f1f43828 (diff)
refactor(tvix/castore/hashing_reader): migrate to rstest r/7862
Change-Id: I99ae0e27b4db4799db8af7cd6b9cc8d7f09227de
Reviewed-on: https://cl.tvl.fyi/c/depot/+/11366
Tested-by: BuildkiteCI
Reviewed-by: picnoir picnoir <picnoir@alternativebit.fr>
-rw-r--r--tvix/castore/src/hashing_reader.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/tvix/castore/src/hashing_reader.rs b/tvix/castore/src/hashing_reader.rs
index 535236324701..7d78cae5877a 100644
--- a/tvix/castore/src/hashing_reader.rs
+++ b/tvix/castore/src/hashing_reader.rs
@@ -62,7 +62,7 @@ where
 mod tests {
     use std::io::Cursor;
 
-    use test_case::test_case;
+    use rstest::rstest;
 
     use crate::fixtures::BLOB_A;
     use crate::fixtures::BLOB_A_DIGEST;
@@ -71,11 +71,12 @@ mod tests {
     use crate::fixtures::EMPTY_BLOB_DIGEST;
     use crate::{B3Digest, B3HashingReader};
 
-    #[test_case(&BLOB_A, &BLOB_A_DIGEST; "blob a")]
-    #[test_case(&BLOB_B, &BLOB_B_DIGEST; "blob b")]
-    #[test_case(&[], &EMPTY_BLOB_DIGEST; "empty blob")]
+    #[rstest]
+    #[case::blob_a(&BLOB_A, &BLOB_A_DIGEST)]
+    #[case::blob_b(&BLOB_B, &BLOB_B_DIGEST)]
+    #[case::empty_blob(&[], &EMPTY_BLOB_DIGEST)]
     #[tokio::test]
-    async fn test_b3_hashing_reader(data: &[u8], b3_digest: &B3Digest) {
+    async fn test_b3_hashing_reader(#[case] data: &[u8], #[case] b3_digest: &B3Digest) {
         let r = Cursor::new(data);
         let mut hr = B3HashingReader::from(r);