aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests
diff options
context:
space:
mode:
authorLibravatar vallentin <mail@vallentin.dev>2021-01-02 23:55:46 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2021-01-05 16:17:14 +0100
commitf9db4446d5325b1cd6fa6154a7630e5138b61975 (patch)
treef6b425191e89b2ca508af6da1072722165d54612 /testing/tests
parentb76f7ef778dd37db08cb4dba2dc9329b15bbe984 (diff)
downloadaskama-f9db4446d5325b1cd6fa6154a7630e5138b61975.tar.gz
askama-f9db4446d5325b1cd6fa6154a7630e5138b61975.tar.bz2
askama-f9db4446d5325b1cd6fa6154a7630e5138b61975.zip
Added copy literals related test case
Diffstat (limited to 'testing/tests')
-rw-r--r--testing/tests/loops.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/testing/tests/loops.rs b/testing/tests/loops.rs
index 4345b4f..809f75e 100644
--- a/testing/tests/loops.rs
+++ b/testing/tests/loops.rs
@@ -93,6 +93,18 @@ fn test_for_method_call() {
#[derive(Template)]
#[template(
+ source = "{% for i in ::std::iter::repeat(\"a\").take(5) %}{{ i }}{% endfor %}",
+ ext = "txt"
+)]
+struct ForPathCallTemplate;
+
+#[test]
+fn test_for_path_call() {
+ assert_eq!(ForPathCallTemplate.render().unwrap(), "aaaaa");
+}
+
+#[derive(Template)]
+#[template(
source = "{% for i in [1, 2, 3, 4, 5][3..] %}{{ i }}{% endfor %}",
ext = "txt"
)]