From bef88f1696b828caf72695561c2270456f35894d Mon Sep 17 00:00:00 2001 From: yossyJ <28825627+yossyJ@users.noreply.github.com> Date: Fri, 4 Jan 2019 23:12:44 +0900 Subject: Add support for tuple --- testing/tests/vars.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'testing/tests/vars.rs') 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 @@ -12,6 +12,22 @@ fn test_let() { assert_eq!(t.render().unwrap(), "foo"); } +#[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> { -- cgit