From 84fe3814033d1ec8669f253964cfa1145b4f53e9 Mon Sep 17 00:00:00 2001 From: René Kijewski Date: Mon, 31 Jan 2022 11:34:48 +0100 Subject: Remove `panic!()` in `loop.cycle([])` --- testing/tests/ui/loop_cycle_empty.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 testing/tests/ui/loop_cycle_empty.rs (limited to 'testing/tests/ui/loop_cycle_empty.rs') 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() { +} -- cgit