From 121212bf297b5a5dbe303383a373117c9c4702bd Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Wed, 16 Sep 2020 10:34:24 +0100 Subject: Add integration tests for into_{f64,isize} Signed-off-by: Yuxuan Shui --- testing/tests/filters.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'testing/tests') 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 @@ -50,6 +50,20 @@ fn filter_fmt() { assert_eq!(t.render().unwrap(), "\"formatted\""); } +#[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> { -- cgit