diff options
author | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-09-07 20:42:54 +0200 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2017-09-07 20:42:54 +0200 |
commit | 92d93e0e8b2098d3e07480e2a5b6fd43f6173985 (patch) | |
tree | dafc09f533d87a65145a8d5932e994ef7189d85a /testing | |
parent | cd4ccd260db6414638ee038d198108face777982 (diff) | |
download | askama-92d93e0e8b2098d3e07480e2a5b6fd43f6173985.tar.gz askama-92d93e0e8b2098d3e07480e2a5b6fd43f6173985.tar.bz2 askama-92d93e0e8b2098d3e07480e2a5b6fd43f6173985.zip |
Add test case for inferred escape mode
Diffstat (limited to 'testing')
-rw-r--r-- | testing/tests/simple.rs | 13 |
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 & me!"); +} |