5 This template is used for Velocity regression testing.
6 If you alter this template make sure you change the
7 corresponding comparison file so that the regression
8 test doesn't fail incorrectly.
10 Tests the range operator [n..m]
14 #foreach($i in [1..5]) $i #end
18 #foreach($i in [0..0]) $i #end
22 #foreach($i in [-4..-5]) $i #end
26 #foreach($i in [ 1 .. 5 ]) $i #end
30 #foreach($i in [5..1]) $i #end
34 #foreach($i in [-5..5]) $i #end
38 #foreach($i in [5..-5]) $i #end
43 refs \$a=$a \$b=$b [\$a..\$b]
44 #foreach($i in [$a..$b]) $i #end
48 #foreach($i in [$a.. 7]) $i #end
52 #foreach($i in [-7 ..$a]) $i #end
56 #foreach($i in[ -7 ..$a]) $i #end
60 setting in \$foo -> [0..5] :
61 #foreach($i in $foo )$i #end
65 Now some use-case examples. Suppose we want a table to have 10 rows
67 #set($arr = ["a","b","c"])
73 #foreach($i in [4..10])
74 <tr><td> </td></tr>