aboutsummaryrefslogtreecommitdiffstats
path: root/testing/tests/ui/loop_cycle_empty.rs
diff options
context:
space:
mode:
authorLibravatar René Kijewski <kijewski@library.vetmed.fu-berlin.de>2022-01-31 11:34:48 +0100
committerLibravatar Dirkjan Ochtman <dirkjan@ochtman.nl>2022-01-31 13:12:09 +0100
commit84fe3814033d1ec8669f253964cfa1145b4f53e9 (patch)
tree015f10bd3acf155f85e9335697dfcea01234942d /testing/tests/ui/loop_cycle_empty.rs
parent0e9c9aeb9ddf8b86eeb86e1822f7285f65bc0b9d (diff)
downloadaskama-84fe3814033d1ec8669f253964cfa1145b4f53e9.tar.gz
askama-84fe3814033d1ec8669f253964cfa1145b4f53e9.tar.bz2
askama-84fe3814033d1ec8669f253964cfa1145b4f53e9.zip
Remove `panic!()` in `loop.cycle([])`
Diffstat (limited to 'testing/tests/ui/loop_cycle_empty.rs')
-rw-r--r--testing/tests/ui/loop_cycle_empty.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/tests/ui/loop_cycle_empty.rs b/testing/tests/ui/loop_cycle_empty.rs
new file mode 100644
index 0000000..4aa6010
--- /dev/null
+++ b/testing/tests/ui/loop_cycle_empty.rs
@@ -0,0 +1,14 @@
+// Nb. this test fails because currently an empty array "[]" is always a syntax error in askama,
+// but even if this changes, this test should keep failing, but possibly with another error message
+
+use askama::Template;
+
+#[derive(Template)]
+#[template(
+ source = r#"{% for v in values %}{{ loop.cycle([]) }}{{ v }},{% endfor %}"#,
+ ext = "txt"
+)]
+struct ForCycleEmpty;
+
+fn main() {
+}