diff options
Diffstat (limited to 'velocity-engine-core/src/test/resources/templates/array.vm')
-rw-r--r-- | velocity-engine-core/src/test/resources/templates/array.vm | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/velocity-engine-core/src/test/resources/templates/array.vm b/velocity-engine-core/src/test/resources/templates/array.vm new file mode 100644 index 00000000..15362e6d --- /dev/null +++ b/velocity-engine-core/src/test/resources/templates/array.vm @@ -0,0 +1,48 @@ +#* + +@test array.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. + +*# + +#set( $foo = [$this, $that, $woog.Bar, [$this, "this"] ]) + +$provider.concat(["a", "b", "c"]) + +#set($foo = "a") +$provider.objConcat( [1..2] ) +$provider.objConcat( ["a","b"] ) +$provider.objConcat( [1..2 ] ) +$provider.objConcat( [$foo] ) +$provider.objConcat( [ $foo] ) +$provider.objConcat( [$foo ] ) + +#macro( showme $array ) + #foreach( $i in $array ) + > $i <#end + +#end + +#set($woog = "a") +#set($floog = "b") +#showme( [ $woog] ) +#showme( [ $woog,$floog] ) +#showme( [1..2]) +#showme( [1 ..2 ]) + +## and more.... + +$p.m( [ $A.g(1), $title ]) +$pp.messageFormat( [ $Abc.get($sti), $title, $ti, $sti, 'bodytext' ], $subtopicTemplate) +#set ($args = [ $pp.nQuestions, $pass, $units ] ) + +## expression in index + +#set($arr = [ 0, 1, 2, 3 ]) +#set($index = 1) + +$arr[$index + $index * 2] |