From 8b0ed6abf6c363b5967029eed87937d39c018af5 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 13 Sep 2020 21:52:14 +0200 Subject: tests: extend for-loop tests to cover local variants Signed-off-by: Jo-Philipp Wich --- tests/00_syntax/16_for_loop | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tests/00_syntax') diff --git a/tests/00_syntax/16_for_loop b/tests/00_syntax/16_for_loop index 4c233bc..4253b5e 100644 --- a/tests/00_syntax/16_for_loop +++ b/tests/00_syntax/16_for_loop @@ -72,6 +72,15 @@ Iteration 8 Iteration 9 A for-in loop using the alternative syntax: +Item 123 +Item 456 +Item 789 + +For-in and counting for loops may declare variables: +Iteration 0 +Iteration 1 +Iteration 2 + Item 123 Item 456 Item 789 @@ -145,4 +154,13 @@ A for-in loop using the alternative syntax: {% for (n in [123, 456, 789]): -%} Item {{ n }} {% endfor %} + +For-in and counting for loops may declare variables: +{% for (local i = 0; i < 3; i++): %} +Iteration {{ i }} +{% endfor %} + +{% for (local n in [123, 456, 789]): %} +Item {{ n }} +{% endfor %} -- End -- -- cgit v1.2.3