diff options
author | yossyJ <28825627+yossyJ@users.noreply.github.com> | 2019-01-04 23:12:44 +0900 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2019-01-04 16:58:09 +0100 |
commit | bef88f1696b828caf72695561c2270456f35894d (patch) | |
tree | fb83e8f9fe1b05a49c18c43adef96a366dc18f6e /testing/tests/loops.rs | |
parent | 39e08325c0e0fba75384579427d1c6f7eca8fbc9 (diff) | |
download | askama-bef88f1696b828caf72695561c2270456f35894d.tar.gz askama-bef88f1696b828caf72695561c2270456f35894d.tar.bz2 askama-bef88f1696b828caf72695561c2270456f35894d.zip |
Add support for tuple
Diffstat (limited to '')
-rw-r--r-- | testing/tests/loops.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/testing/tests/loops.rs b/testing/tests/loops.rs index 3dfad38..b5fac7c 100644 --- a/testing/tests/loops.rs +++ b/testing/tests/loops.rs @@ -4,14 +4,19 @@ use askama::Template; #[template(path = "for.html")] struct ForTemplate<'a> { strings: Vec<&'a str>, + tuple_strings: Vec<(&'a str, &'a str)>, } #[test] fn test_for() { let s = ForTemplate { strings: vec!["A", "alfa", "1"], + tuple_strings: vec![("B", "beta")], }; - assert_eq!(s.render().unwrap(), "0. A (first)\n1. alfa\n2. 1\n"); + assert_eq!( + s.render().unwrap(), + "0. A (first)\n1. alfa\n2. 1\n\n0. B,beta (first)\n" + ); } #[derive(Template)] |