aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/simple.rs
diff options
context:
space:
mode:
authorLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-10-20 10:09:50 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2017-10-20 10:09:50 +0200
commit4af73a868c7d35641f8a1bcd0a82f8c7db411d8d (patch)
tree1161aad02f2e453c1f800bc6a1730fbfb8bea671 /testing/tests/simple.rs
parent3d9048ab50b1030ff741371ed0d853fcc3ab5780 (diff)
downloadaskama-4af73a868c7d35641f8a1bcd0a82f8c7db411d8d.tar.gz
askama-4af73a868c7d35641f8a1bcd0a82f8c7db411d8d.tar.bz2
askama-4af73a868c7d35641f8a1bcd0a82f8c7db411d8d.zip
Add support for array literals (fixes #59)
Diffstat (limited to '')
-rw-r--r--testing/tests/simple.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/testing/tests/simple.rs b/testing/tests/simple.rs
index fd30499..bee5690 100644
--- a/testing/tests/simple.rs
+++ b/testing/tests/simple.rs
@@ -184,3 +184,14 @@ fn test_path_compare() {
let t = PathCompareTemplate { x: Alphabet::Alpha };
assert_eq!(t.render().unwrap(), "true");
}
+
+
+#[derive(Template)]
+#[template(source = "{% for i in [1, 2] %}{{ i }}{% endfor %}", ext = "txt")]
+struct ArrayTemplate {}
+
+#[test]
+fn test_slice_literal() {
+ let t = ArrayTemplate {};
+ assert_eq!(t.render().unwrap(), "12");
+}