use html_node::{html, text}; #[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_format() { 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); } #[cfg(feature = "pretty")] #[test] fn pretty_printed_helper() { let pretty_html = html! {

Pretty Printing Wrapper Test

This test should be pretty printed!

} .pretty(); println!("Pretty helper:\n{pretty_html}"); let expected = r#"

Pretty Printing Wrapper Test

This test should be pretty printed!

"#; assert_eq!(expected, pretty_html.to_string()); }