From 4e919e47539b5fa346f1cac323ab250558b834bc Mon Sep 17 00:00:00 2001 From: Lars Erik Rosengren Date: Sun, 10 Sep 2017 20:01:09 +0200 Subject: Add support for tuple indexing in templates --- testing/tests/simple.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'testing/tests') diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs index eac7c4b..d2111f0 100644 --- a/testing/tests/simple.rs +++ b/testing/tests/simple.rs @@ -93,6 +93,18 @@ fn test_attr() { assert_eq!(t.render().unwrap(), "5"); } +#[derive(Template)] +#[template(path = "tuple-attr.html")] +struct TupleAttrTemplate<'a> { + tuple: (&'a str, &'a str), +} + +#[test] +fn test_tuple_attr() { + let t = TupleAttrTemplate { tuple: ("foo", "bar") }; + assert_eq!(t.render().unwrap(), "foobar"); +} + struct NestedHolder { holder: Holder, -- cgit