From b2760d74a01fab5da6efd213d1700eb2fe20a50f Mon Sep 17 00:00:00 2001 From: Szepesi Tibor Date: Mon, 29 Jul 2024 20:59:38 +0200 Subject: [PATCH] Don't use should_panic --- iam-common/src/id.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/iam-common/src/id.rs b/iam-common/src/id.rs index cf24625..8b526d8 100644 --- a/iam-common/src/id.rs +++ b/iam-common/src/id.rs @@ -171,21 +171,21 @@ mod tests { } #[test] - #[should_panic] fn from_str_invalid_type() { - Id::from_str("Invalid-00000000-0000-0000-0000-000000000000").unwrap(); + let id = Id::from_str("Invalid-00000000-0000-0000-0000-000000000000"); + assert!(id.is_err()); } #[test] - #[should_panic] fn from_str_invalid_uuid() { - Id::from_str("UserID-invalid").unwrap(); + let id = Id::from_str("UserID-invalid"); + assert!(id.is_err()); } #[test] - #[should_panic] fn from_str_invalid_format() { - Id::from_str("invalid").unwrap(); + let id = Id::from_str("invalid"); + assert!(id.is_err()); } #[test]