diff options
Diffstat (limited to '')
-rw-r--r-- | testing/templates/format.html | 1 | ||||
-rw-r--r-- | testing/tests/filters.rs | 13 |
2 files changed, 14 insertions, 0 deletions
diff --git a/testing/templates/format.html b/testing/templates/format.html new file mode 100644 index 0000000..aba58fd --- /dev/null +++ b/testing/templates/format.html @@ -0,0 +1 @@ +{{ "{:?}"|format(var) }} 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 <html> is unsafe & 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"); +} |