use std::sync::Arc; use sidoc::{Builder, RenderContext}; #[test] fn simple_html() { let mut bldr = Builder::new(); bldr.line(""); bldr.scope("", Some("")).exit(); let doc = bldr.build().unwrap(); let mut r = RenderContext::new(); r.doc("hello", Arc::new(doc)); let buf = r.render("hello").unwrap(); assert_eq!(buf, "\n\n\n"); } #[test] fn simple_html_head() { let mut bldr = Builder::new(); bldr .line("") .scope("", Some("")) .scope("", Some("")) .exit() .exit(); let doc = bldr.build().unwrap(); let mut r = RenderContext::new(); r.doc("root", Arc::new(doc)); let buf = r.render("root").unwrap(); assert_eq!( buf, "\n\n \n \n\n" ); } // vim: set ft=rust et sw=2 ts=2 sts=2 cinoptions=2 tw=79 :