diff options
author | Jo-Philipp Wich <jo@mein.io> | 2020-09-13 21:52:14 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2020-09-13 21:52:14 +0200 |
commit | 8b0ed6abf6c363b5967029eed87937d39c018af5 (patch) | |
tree | 234bd15464f1cc89d383a69726ada9e4c6c5c9b2 /tests | |
parent | f2c5937fdfe0331790fc4c7a64c9df0b8d56c705 (diff) |
tests: extend for-loop tests to cover local variants
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/00_syntax/16_for_loop | 18 |
1 files changed, 18 insertions, 0 deletions
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 @@ -75,6 +75,15 @@ 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 -- End -- -- Testcase -- @@ -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 -- |