From 92d93e0e8b2098d3e07480e2a5b6fd43f6173985 Mon Sep 17 00:00:00 2001 From: Dirkjan Ochtman Date: Thu, 7 Sep 2017 20:42:54 +0200 Subject: Add test case for inferred escape mode --- testing/tests/simple.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'testing/tests') diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index 8fd61d2..a05b956 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -220,3 +220,16 @@ fn test_unescaped() { let t = UnescapedTemplate { foo: "foo & bar" }; assert_eq!(t.render().unwrap(), "foo & bar"); } + + +#[derive(Template)] +#[template(path = "hello.html")] +struct PathBasedEscapedTemplate<'a> { + name: &'a str, +} + +#[test] +fn test_path_based_escaped() { + let t = PathBasedEscapedTemplate { name: "you & me" }; + assert_eq!(t.render().unwrap(), "Hello, you & me!"); +} -- cgit