aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-02-18 14:02:59 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-02-18 14:02:59 +0100
commitf2ea1408cf9fb4baf2d68d6624161d104f115e37 (patch)
tree107fef4f02222b5d976ec841af3dd9163a72cd7c /testing/tests
parenta4588dc02d82ed88084fdf94fc703bb02d2f9971 (diff)
downloadaskama-f2ea1408cf9fb4baf2d68d6624161d104f115e37.tar.gz
askama-f2ea1408cf9fb4baf2d68d6624161d104f115e37.tar.bz2
askama-f2ea1408cf9fb4baf2d68d6624161d104f115e37.zip
Add test for format filter
Diffstat (limited to 'testing/tests')
-rw-r--r--testing/tests/filters.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/testing/tests/filters.rs b/testing/tests/filters.rs
index d70d1c8..73b660a 100644
--- a/testing/tests/filters.rs
+++ b/testing/tests/filters.rs
@@ -18,3 +18,16 @@ fn filter_escape() {
assert_eq!(s.render(),
"my &lt;html&gt; is unsafe &amp; should be escaped\n");
}
+
+
+#[derive(Template)]
+#[template(path = "format.html")]
+struct FormatTemplate<'a> {
+ var: &'a str,
+}
+
+#[test]
+fn filter_format() {
+ let t = FormatTemplate { var: "formatted" };
+ assert_eq!(t.render(), "\"formatted\"\n");
+}