Debian Codegraph @

tests/whitespace.rs

raw symbols SCIP
1 use handlebars::Handlebars;
2 use serde_json::json;
3
4 #[test]
5 fn test_whitespaces_elision() {
6 let hbs = Handlebars::new();
7 assert_eq!(
8 "bar",
9 hbs.render_template(" {{~ foo ~}} ", &json!({"foo": "bar"}))
10 .unwrap()
11 );
12
13 assert_eq!(
14 "<bar/>",
15 hbs.render_template(" {{{~ foo ~}}} ", &json!({"foo": "<bar/>"}))
16 .unwrap()
17 );
18
19 assert_eq!(
20 "<bar/>",
21 hbs.render_template(" {{~ {foo} ~}} ", &json!({"foo": "<bar/>"}))
22 .unwrap()
23 );
24 }