• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#**
2
3@test velocimacro2.vm
4
5This template is used for Velocity regression testing.
6If you alter this template make sure you change the
7corresponding comparison file so that the regression
8test doesn't fail incorrectly.
9
10*#
11#macro( foo $a )
12  Hello from foo : $a
13#end
14
15#macro( foo2 $a )
16  Hello from foo2 : $a
17#end
18
19#macro( foo_two $a )
20  Hello from foo_two : $a
21#end
22
23#foo( "hi" )
24#foo2( "hi" )
25#foo_two( "hi" )
26
27
28#foo( $notincontext )
29#foo( $notincontext.getThing() )
30
31#macro( tester $a )
32  #if($a)
33    $a :  yes
34  #else
35    $a :  no
36  #end
37#end
38
39##
40## test to see if we can print these
41## as schmoo
42##
43
44#tester( $notincontext )
45#tester( $notincontext.woogie() )
46
47#set($foo = "bar")
48
49#tester($foo)
50
51#foo2( ${foo} )
52
53#macro( poundthis $truth )
54  #if ($truth )
55    <td align=center class=v10><b>#</b></td>
56    <td align=center class=v10><b> # </b></td>
57    <td align=center class=v10><b>\#</b></td>
58  #end
59#end
60
61#poundthis( true )
62
63##
64## test for bug reported when stringlit changed to on-init parsing
65##
66
67#macro( blorp $bar ) $bar #end
68#macro( schlorp $i )#blorp( "hi $i" ) #end
69
70#schlorp("victor")
71
72
73##
74## test all directive arg types
75##
76
77#macro(dirarg $a)
78>$a<
79#end
80
81#set($ref = 1)
82
83#dirarg(1)
84#dirarg(true)
85#dirarg(false)
86#dirarg("hello")
87#dirarg('hello')
88#dirarg($ref)
89#dirarg([1..10])
90#dirarg(['a','b',$ref])
91
92