aboutsummaryrefslogtreecommitdiffstats
path: root/testing
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--testing/tests/filters.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/testing/tests/filters.rs b/testing/tests/filters.rs
index b02a64b..035e5da 100644
--- a/testing/tests/filters.rs
+++ b/testing/tests/filters.rs
@@ -39,6 +39,18 @@ fn filter_format() {
}
#[derive(Template)]
+#[template(source = "{{ var|fmt(\"{:?}\") }}", ext = "html", escape = "none")]
+struct FmtTemplate<'a> {
+ var: &'a str,
+}
+
+#[test]
+fn filter_fmt() {
+ let t = FmtTemplate { var: "formatted" };
+ assert_eq!(t.render().unwrap(), "\"formatted\"");
+}
+
+#[derive(Template)]
#[template(source = "{{ s|myfilter }}", ext = "txt")]
struct MyFilterTemplate<'a> {
s: &'a str,