aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/ui/loop_cycle_wrong_argument_count.rs
diff options
context:
space:
mode:
authorLibravatar René Kijewski <kijewski@library.vetmed.fu-berlin.de>2021-07-18 11:42:47 +0200
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2021-11-11 10:05:34 +0100
commitcfe83bcb73b9e0cfd8a2d3151e4cab38327eabea (patch)
treea4e5b40e033b0d3cfc0d1b48298cb9f9e185d3dd /testing/tests/ui/loop_cycle_wrong_argument_count.rs
parentf06022c70f2411252ad7ebb8214e0826beaefcf8 (diff)
downloadaskama-cfe83bcb73b9e0cfd8a2d3151e4cab38327eabea.tar.gz
askama-cfe83bcb73b9e0cfd8a2d3151e4cab38327eabea.tar.bz2
askama-cfe83bcb73b9e0cfd8a2d3151e4cab38327eabea.zip
Implement {{loop.cycle(…)}} similar to Jinja
Diffstat (limited to 'testing/tests/ui/loop_cycle_wrong_argument_count.rs')
-rw-r--r--testing/tests/ui/loop_cycle_wrong_argument_count.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/testing/tests/ui/loop_cycle_wrong_argument_count.rs b/testing/tests/ui/loop_cycle_wrong_argument_count.rs
new file mode 100644
index 0000000..e87f4f4
--- /dev/null
+++ b/testing/tests/ui/loop_cycle_wrong_argument_count.rs
@@ -0,0 +1,13 @@
+use askama::Template;
+
+#[derive(Template)]
+#[template(
+ source = r#"{% for v in values %}{{ loop.cycle("r", "g", "b") }}{{ v }},{% endfor %}"#,
+ ext = "txt"
+)]
+struct ForCycle<'a> {
+ values: &'a [u8],
+}
+
+fn main() {
+}