diff --git a/src/tests/mod.rs b/src/tests/mod.rs index b699b4f..802c364 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -48,6 +48,7 @@ impl From for AssertionError { #[macro_export] macro_rules! assert_or_err { ($s:expr) => { + #[allow(clippy::bool_comparison)] if !$s { return Err($crate::tests::AssertionError::new(&format!( "assertion failed at line {}: {}", @@ -58,6 +59,18 @@ macro_rules! assert_or_err { } }; ($s:expr, $msg:literal) => { + #[allow(clippy::bool_comparison)] + if !$s { + return Err($crate::tests::AssertionError::new(&format!( + "{} (line {})", + $msg, + std::line!(), + )) + .into()); + } + }; + ($s:expr, raw $msg:literal) => { + #[allow(clippy::bool_comparison)] if !$s { return Err($crate::tests::AssertionError::new($msg).into()); }