aboutsummaryrefslogtreecommitdiff
path: root/velocity-engine-core/src/test/resources/templates/velocimacro2.vm
diff options
context:
space:
mode:
Diffstat (limited to 'velocity-engine-core/src/test/resources/templates/velocimacro2.vm')
-rw-r--r--velocity-engine-core/src/test/resources/templates/velocimacro2.vm91
1 files changed, 91 insertions, 0 deletions
diff --git a/velocity-engine-core/src/test/resources/templates/velocimacro2.vm b/velocity-engine-core/src/test/resources/templates/velocimacro2.vm
new file mode 100644
index 00000000..e1577616
--- /dev/null
+++ b/velocity-engine-core/src/test/resources/templates/velocimacro2.vm
@@ -0,0 +1,91 @@
+#**
+
+@test velocimacro2.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.
+
+*#
+#macro( foo $a )
+ Hello from foo : $a
+#end
+
+#macro( foo2 $a )
+ Hello from foo2 : $a
+#end
+
+#macro( foo_two $a )
+ Hello from foo_two : $a
+#end
+
+#foo( "hi" )
+#foo2( "hi" )
+#foo_two( "hi" )
+
+
+#foo( $notincontext )
+#foo( $notincontext.getThing() )
+
+#macro( tester $a )
+ #if($a)
+ $a : yes
+ #else
+ $a : no
+ #end
+#end
+
+##
+## test to see if we can print these
+## as schmoo
+##
+
+#tester( $notincontext )
+#tester( $notincontext.woogie() )
+
+#set($foo = "bar")
+
+#tester($foo)
+
+#foo2( ${foo} )
+
+#macro( poundthis $truth )
+ #if ($truth )
+ <td align=center class=v10><b>#</b></td>
+ <td align=center class=v10><b> # </b></td>
+ <td align=center class=v10><b>\#</b></td>
+ #end
+#end
+
+#poundthis( true )
+
+##
+## test for bug reported when stringlit changed to on-init parsing
+##
+
+#macro( blorp $bar ) $bar #end
+#macro( schlorp $i )#blorp( "hi $i" ) #end
+
+#schlorp("victor")
+
+
+##
+## test all directive arg types
+##
+
+#macro(dirarg $a)
+>$a<
+#end
+
+#set($ref = 1)
+
+#dirarg(1)
+#dirarg(true)
+#dirarg(false)
+#dirarg("hello")
+#dirarg('hello')
+#dirarg($ref)
+#dirarg([1..10])
+#dirarg(['a','b',$ref])
+