You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: template_tests/set.tpl
+25-1Lines changed: 25 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,4 +3,28 @@
3
3
{{ new_var }}{% for item in simple.misc_list %}
4
4
{% set new_var = item %}{{ new_var }}{% endfor %}
5
5
{{ new_var }}
6
-
{% set car=someUndefinedVar %}{{ car.Drive }}No Panic
6
+
{% set car=someUndefinedVar %}{{ car.Drive }}No Panic
7
+
8
+
{% set new_var = ["hello", "val2"] %}
9
+
10
+
{% for var in new_var %}{{ var }}
11
+
{% endfor %}
12
+
13
+
{% set int_variables = [1, 2, 3] %}{% for var in int_variables %}{{ var }}
14
+
{% endfor %}
15
+
16
+
{% set mixed_variables = [1, "two", 3.5, "4"] %}{% for var in mixed_variables %}{{ var }}
17
+
{% endfor %}
18
+
19
+
{% set empty_set = [] %}{% for var in empty_set %}{{ var }}
20
+
{% endfor %}
21
+
22
+
{% set item = "item1"%}
23
+
{% set ref_set = [item, "item2", some_random_variable] %}{% for var in ref_set %}{{ var }}
24
+
{% endfor %}
25
+
26
+
{% set nil_item_set = [nil] %}{% for var in nil_item_set %}-{{ var }}-{# printing an additional dash here to show the loop over the array with a nil item #}
27
+
{% endfor %}
28
+
29
+
{% set nil_set = nil %}{% for var in nil_set %}-{{ var }} {# printing an additional dash here to show that the nil array won't be looped #}
0 commit comments