diff options
Diffstat (limited to 'testing')
-rw-r--r-- | testing/tests/filters.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/tests/filters.rs b/testing/tests/filters.rs index 035e5da..22a8fa9 100644 --- a/testing/tests/filters.rs +++ b/testing/tests/filters.rs @@ -51,6 +51,20 @@ fn filter_fmt() { } #[derive(Template)] +#[template( + source = "{{ 1|into_f64 }} {{ 1.9|into_isize }}", + ext = "txt", + escape = "none" +)] +struct IntoNumbersTemplate; + +#[test] +fn into_numbers_fmt() { + let t = IntoNumbersTemplate; + assert_eq!(t.render().unwrap(), "1 1"); +} + +#[derive(Template)] #[template(source = "{{ s|myfilter }}", ext = "txt")] struct MyFilterTemplate<'a> { s: &'a str, |