aboutsummaryrefslogtreecommitdiff
path: root/velocity-engine-core/src/test/resources/templates/array.vm
diff options
context:
space:
mode:
authorAndrew Vuong <akvuong@google.com>2023-02-22 21:17:27 +0000
committerAndrew Vuong <akvuong@google.com>2023-02-22 21:17:27 +0000
commit757677e8848ed434bb36206b674db6d601cbe5e5 (patch)
tree2ab78e0ae0cda6d3ac8006cd6e0c6be8dc78a873 /velocity-engine-core/src/test/resources/templates/array.vm
parentbc4c7a291f1579e1b6b903dc43b707a755577565 (diff)
parentf2461dce3a7455fc0416a7b0b95ed4021eff714d (diff)
downloadapache-velocity-engine-757677e8848ed434bb36206b674db6d601cbe5e5.tar.gz
Merge of apache-velocity-engine from aosp/masteraml_tz4_332714010
Bug: 262898801 Test: mma Change-Id: I68491a2e8b89245a1bff44d86023cec475ff902d
Diffstat (limited to 'velocity-engine-core/src/test/resources/templates/array.vm')
-rw-r--r--velocity-engine-core/src/test/resources/templates/array.vm48
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]