diff options
author | Yuxuan Shui <yshuiv7@gmail.com> | 2020-09-16 10:34:24 +0100 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2020-09-16 11:49:16 +0200 |
commit | 121212bf297b5a5dbe303383a373117c9c4702bd (patch) | |
tree | 5b551a2afebe2af2bbe4ee399ea347f49b3c36ed /testing | |
parent | ba8a4f836c75dff63f026bd432d3a8659e5de394 (diff) | |
download | askama-121212bf297b5a5dbe303383a373117c9c4702bd.tar.gz askama-121212bf297b5a5dbe303383a373117c9c4702bd.tar.bz2 askama-121212bf297b5a5dbe303383a373117c9c4702bd.zip |
Add integration tests for into_{f64,isize}
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Diffstat (limited to '')
-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, |