diff --git a/tvix/castore/src/blobservice/from_addr.rs b/tvix/castore/src/blobservice/from_addr.rs index db221f05a..1f73c802c 100644 --- a/tvix/castore/src/blobservice/from_addr.rs +++ b/tvix/castore/src/blobservice/from_addr.rs @@ -115,7 +115,11 @@ mod tests { /// Correct scheme to connect to localhost over http, but with additional path, which is invalid. #[test_case("grpc+http://localhost/some-path", false; "grpc valid invalid host and path")] #[tokio::test] - async fn test_from_addr_tokio(uri_str: &str, is_ok: bool) { - assert_eq!(from_addr(uri_str).await.is_ok(), is_ok) + async fn test_from_addr_tokio(uri_str: &str, exp_succeed: bool) { + if exp_succeed { + from_addr(uri_str).await.expect("should succeed"); + } else { + assert!(from_addr(uri_str).await.is_err(), "should fail"); + } } } diff --git a/tvix/castore/src/directoryservice/from_addr.rs b/tvix/castore/src/directoryservice/from_addr.rs index 0a5a0464c..14251ee4b 100644 --- a/tvix/castore/src/directoryservice/from_addr.rs +++ b/tvix/castore/src/directoryservice/from_addr.rs @@ -114,7 +114,11 @@ mod tests { /// Correct scheme to connect to localhost over http, but with additional path, which is invalid. #[test_case("grpc+http://localhost/some-path", false; "grpc valid invalid host and path")] #[tokio::test] - async fn test_from_addr_tokio(uri_str: &str, is_ok: bool) { - assert_eq!(from_addr(uri_str).await.is_ok(), is_ok) + async fn test_from_addr_tokio(uri_str: &str, exp_succeed: bool) { + if exp_succeed { + from_addr(uri_str).await.expect("should succeed"); + } else { + assert!(from_addr(uri_str).await.is_err(), "should fail"); + } } } diff --git a/tvix/store/src/pathinfoservice/from_addr.rs b/tvix/store/src/pathinfoservice/from_addr.rs index 5113b19c1..f5a287cd7 100644 --- a/tvix/store/src/pathinfoservice/from_addr.rs +++ b/tvix/store/src/pathinfoservice/from_addr.rs @@ -174,7 +174,7 @@ mod tests { /// Correct scheme to connect to localhost over http, but with additional path, which is invalid. #[test_case("grpc+http://localhost/some-path", false; "grpc valid invalid host and path")] #[tokio::test] - async fn test_from_addr_tokio(uri_str: &str, is_ok: bool) { + async fn test_from_addr_tokio(uri_str: &str, exp_succeed: bool) { let resp = from_addr( uri_str, gen_blob_service().into(), @@ -182,6 +182,10 @@ mod tests { ) .await; - assert_eq!(resp.is_ok(), is_ok); + if exp_succeed { + resp.expect("should succeed"); + } else { + assert!(resp.is_err(), "should fail"); + } } }