aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/simple.rs
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-09-07 20:42:54 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-09-07 20:42:54 +0200
commit92d93e0e8b2098d3e07480e2a5b6fd43f6173985 (patch)
treedafc09f533d87a65145a8d5932e994ef7189d85a /testing/tests/simple.rs
parentcd4ccd260db6414638ee038d198108face777982 (diff)
downloadaskama-92d93e0e8b2098d3e07480e2a5b6fd43f6173985.tar.gz
askama-92d93e0e8b2098d3e07480e2a5b6fd43f6173985.tar.bz2
askama-92d93e0e8b2098d3e07480e2a5b6fd43f6173985.zip
Add test case for inferred escape mode
Diffstat (limited to 'testing/tests/simple.rs')
-rw-r--r--testing/tests/simple.rs13
1 files changed, 13 insertions, 0 deletions
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 &amp; me!");
+}