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/vars.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/vars.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/tests/vars.rs b/testing/tests/vars.rs index 87af3f6..04f9ff2 100644 --- a/testing/tests/vars.rs +++ b/testing/tests/vars.rs @@ -13,6 +13,22 @@ fn test_let() { } #[derive(Template)] +#[template(path = "let.html")] +struct LetTupleTemplate<'a> { + s: &'a str, + t: (&'a str, &'a str), +} + +#[test] +fn test_let_tuple() { + let t = LetTupleTemplate { + s: "foo", + t: ("bar", "bazz"), + }; + assert_eq!(t.render().unwrap(), "foo\nbarbazz"); +} + +#[derive(Template)] #[template(path = "let-decl.html")] struct LetDeclTemplate<'a> { cond: bool, |