aboutsummaryrefslogtreecommitdiff
path: root/velocity-engine-core/src/test/resources/templates/foreach-variable.vm
diff options
context:
space:
mode:
Diffstat (limited to 'velocity-engine-core/src/test/resources/templates/foreach-variable.vm')
-rw-r--r--velocity-engine-core/src/test/resources/templates/foreach-variable.vm44
1 files changed, 44 insertions, 0 deletions
diff --git a/velocity-engine-core/src/test/resources/templates/foreach-variable.vm b/velocity-engine-core/src/test/resources/templates/foreach-variable.vm
new file mode 100644
index 00000000..3b6be489
--- /dev/null
+++ b/velocity-engine-core/src/test/resources/templates/foreach-variable.vm
@@ -0,0 +1,44 @@
+#*
+
+@test foreach-variable.vm
+
+This template is used for Velocity regression testing.
+If you alter this template make sure you change the
+corresponding comparison file so that the regression
+test doesn't fail incorrectly.
+
+*#
+
+Foreach with a variable.
+
+#foreach ($element in $list)
+ This is $element.
+ $foreach.count
+#end
+
+#foreach ($element in $list)
+ -- inner foreach --
+ #foreach ($element in $list)
+ This is $element.
+ $foreach.count
+ #end
+ -- inner foreach --
+
+ -- outer foreach --
+ This is $element.
+ $foreach.count
+ -- outer foreach --
+#end
+
+#foreach(${item} in ${list})
+$item ${item}
+#end
+
+#foreach(${item} in $list)
+$item ${item}
+#end
+
+#foreach($item in ${list})
+$item ${item}
+#end
+