]> git.proxmox.com Git - rustc.git/blob - vendor/handlebars-3.5.5/tests/escape.rs
New upstream version 1.70.0+dfsg2
[rustc.git] / vendor / handlebars-3.5.5 / tests / escape.rs
1 extern crate handlebars;
2
3 #[macro_use]
4 extern crate serde_json;
5
6 use handlebars::Handlebars;
7
8 #[test]
9 fn test_escape_216() {
10 let hbs = Handlebars::new();
11
12 let data = json!({
13 "FOO": "foo",
14 "BAR": "bar"
15 });
16
17 assert_eq!(
18 hbs.render_template(r"\\\\ {{FOO}} {{BAR}} {{FOO}}{{BAR}} {{FOO}}#{{BAR}} {{FOO}}//{{BAR}} {{FOO}}\\{{FOO}} {{FOO}}\\\\{{FOO}}\\\{{FOO}} \\\{{FOO}} \{{FOO}} \{{FOO}}", &data).unwrap(),
19 r"\\\\ foo bar foobar foo#bar foo//bar foo\foo foo\\\foo\\foo \\foo {{FOO}} {{FOO}}"
20 );
21 }