diff --git a/v0.5/fastn-unresolved/src/parser/component_invocation.rs b/v0.5/fastn-unresolved/src/parser/component_invocation.rs index d8417eac4..f278b34d9 100644 --- a/v0.5/fastn-unresolved/src/parser/component_invocation.rs +++ b/v0.5/fastn-unresolved/src/parser/component_invocation.rs @@ -23,16 +23,15 @@ pub(super) fn component_invocation( #[cfg(test)] mod tests { - fn tester( - mut d: fastn_unresolved::Document, - source: &str, - expected: serde_json::Value, - ) -> bool { + fn tester(mut d: fastn_unresolved::Document, source: &str, expected: serde_json::Value) { assert!(d.imports.is_empty()); assert!(d.definitions.is_empty()); assert_eq!(d.content.len(), 1); - fastn_section::JDebug::debug(&d.content.pop().unwrap(), source) == expected + assert_eq!( + fastn_section::JDebug::debug(&d.content.pop().unwrap(), source), + expected + ) } fastn_unresolved::tt!(super::component_invocation, tester); diff --git a/v0.5/fastn-unresolved/src/parser/import.rs b/v0.5/fastn-unresolved/src/parser/import.rs index 32ac36c1f..a5353afa0 100644 --- a/v0.5/fastn-unresolved/src/parser/import.rs +++ b/v0.5/fastn-unresolved/src/parser/import.rs @@ -108,16 +108,16 @@ fn aliasable(s: &str) -> fastn_unresolved::AliasableIdentifier { #[cfg(test)] mod tests { - fn tester( - mut d: fastn_unresolved::Document, - source: &str, - expected: serde_json::Value, - ) -> bool { + #[track_caller] + fn tester(mut d: fastn_unresolved::Document, source: &str, expected: serde_json::Value) { assert!(d.content.is_empty()); assert!(d.definitions.is_empty()); assert_eq!(d.imports.len(), 1); - fastn_section::JDebug::debug(&d.imports.pop().unwrap(), source) == expected + assert_eq!( + fastn_section::JDebug::debug(&d.imports.pop().unwrap(), source), + expected + ) } fastn_unresolved::tt!(super::import, tester); diff --git a/v0.5/fastn-unresolved/src/parser/mod.rs b/v0.5/fastn-unresolved/src/parser/mod.rs index eaea22525..6290bca22 100644 --- a/v0.5/fastn-unresolved/src/parser/mod.rs +++ b/v0.5/fastn-unresolved/src/parser/mod.rs @@ -45,7 +45,7 @@ pub fn parse(_document_id: &str, source: &str) -> fastn_unresolved::Document { fn t1(source: &str, expected: serde_json::Value, parser: PARSER, tester: TESTER) where PARSER: Fn(&str, fastn_section::Section, &mut fastn_unresolved::Document), - TESTER: FnOnce(fastn_unresolved::Document, &str, serde_json::Value) -> bool, + TESTER: FnOnce(fastn_unresolved::Document, &str, serde_json::Value), { println!("--------- testing -----------\n{source}\n--------- source ------------"); @@ -60,7 +60,7 @@ where // assert everything else is empty parser(source, section, &mut document); - assert!(tester(document, source, expected)); + tester(document, source, expected); } #[cfg(test)]