diff options
Diffstat (limited to 'testing/tests')
-rw-r--r-- | testing/tests/filters.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/tests/filters.rs b/testing/tests/filters.rs new file mode 100644 index 0000000..abde750 --- /dev/null +++ b/testing/tests/filters.rs @@ -0,0 +1,22 @@ +#![feature(proc_macro)] + +#[macro_use] +extern crate askama_derive; +extern crate askama; + +use askama::Template; + +#[derive(Template)] +#[template(path = "filters.html")] +struct TestTemplate { + strvar: String, +} + +#[test] +fn filter_escape() { + let s = TestTemplate { + strvar: "my <html> is unsafe & should be escaped".to_string(), + }; + assert_eq!(s.render(), + "my <html> is unsafe & should be escaped\n"); +} |