use html_node::{ text, typed::{self, elements::*, html}, }; #[test] fn basic() { let shopping_list = vec!["milk", "eggs", "bread"]; let html = html! {

Shopping List

}; let expected = "\
\

Shopping List

\ \
\ "; assert_eq!(html.to_string(), expected); } #[test] fn pretty_printed() { let shopping_list = vec!["milk", "eggs", "bread"]; let html = html! {

Shopping List

}; println!("--- pretty-printed ---\n{html:#}"); let expected = "\

Shopping List

\ "; let pretty_html = format!("{html:#}"); assert_eq!(pretty_html, expected); } #[test] fn component() { typed::component! { ShoppingListItem { index: i32, }; |ShoppingListItemAttributes { index }, _, children| html! {
  • } } let shopping_list = vec!["milk", "eggs", "bread"]; let html = html! {

    Shopping List

    }; let expected = "\
    \

    Shopping List

    \ \
    \ "; assert_eq!(html.to_string(), expected); }