use handbar::Handbar; use serde_json::json; #[test] fn test_whitespaces_elision() { let hbs = Handbar::new(); assert_eq!( "bar", hbs.render_template(" {{~ foo ~}} ", &json!({"foo": "bar"})) .unwrap() ); assert_eq!( "", hbs.render_template(" {{{~ foo ~}}} ", &json!({"foo": ""})) .unwrap() ); assert_eq!( "", hbs.render_template(" {{~ {foo} ~}} ", &json!({"foo": ""})) .unwrap() ); }