aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/simple.rs
diff options
context:
space:
mode:
authorLibravatar Lars Erik Rosengren <larserik.rosengren@gmail.com>2017-09-10 20:01:09 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-09-10 20:15:15 +0200
commit4e919e47539b5fa346f1cac323ab250558b834bc (patch)
tree6adf1b6ae70552892caf708642279f872fd57e0c /testing/tests/simple.rs
parent08bf32b7577b6d2d9638e14980eca286b735c7aa (diff)
downloadaskama-4e919e47539b5fa346f1cac323ab250558b834bc.tar.gz
askama-4e919e47539b5fa346f1cac323ab250558b834bc.tar.bz2
askama-4e919e47539b5fa346f1cac323ab250558b834bc.zip
Add support for tuple indexing in templates
Diffstat (limited to 'testing/tests/simple.rs')
-rw-r--r--testing/tests/simple.rs12
1 files changed, 12 insertions, 0 deletions
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,