use rdxl::xhtml; use std::fmt; struct MyStruct { a: u64, b: u64 } impl fmt::Display for MyStruct { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "MyStruct{{a:{}, b:{}}}", self.a, self.b) } } #[test] fn vars1(){ let my_int = 22; assert_eq!( xhtml!(
{{ my_int }}
), "
22
".to_string() ); } #[test] fn vars2() { let my_str = "ndklasfjkli"; assert_eq!( xhtml!(
{{ my_str }}
), "
ndklasfjkli
".to_string() ); } #[test] fn vars3() { let my_struct = MyStruct { a:1, b:2 }; assert_eq!( xhtml!(
{{ my_struct }}
), "
MyStruct{a:1, b:2}
".to_string() ); }