use tidyrs::embed::Verbatim; use tidyrs::html::{Settings, format}; fn html(text: &str) -> String { let settings = Settings { filepath: Some("index.html".into()), ..Settings::default() }; format(text, &settings, &mut Verbatim).unwrap() } #[test] fn formats_a_document() { assert_eq!( html( "Hi

Hello world

" ), "\n\n \n Hi\n \n \n

Hello world

\n \n\n" ); } #[test] fn prints_attributes() { assert_eq!( html( "
\n" ), "\n \n\n" ); } #[test] fn prints_quotes_and_entities() { assert_eq!( html( "
\n" ), "\n \n\n" ); } #[test] fn prints_borrowed_markers_once() { assert_eq!(html("a"), "a\n"); assert_eq!(html("


"), "


\n"); assert_eq!( html("ac"), "ac\n" ); }