1#* 2 3@test pedantic.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#set( $pedantic = "pedantic") 12 13This is a test of the new #if($pedantic)$pedantic#end mode. 14 15There are a few things you can do in #if($foobar) GOOGLE! #else$pedantic#end mode. 16 17Like get the spacing between things #foreach($a in $stringarray)$a#end to be really, really tight. 18 19Further, it now binds any \n to the control structures, taking them out of the output. 20The hope that this is What You Expect. 21So... 22 23-- 24#if ($pedantic) 25$pedantic 26#end 27-- 28 29should come out looking like 30 31-- 32pedantic 33-- 34 35But pay attention to what follows the \#end statement : 36 371) First, follow with 'stuff' (not sure why you want to do this... but anway...) 38 39-- 40#if ($pedantic) 41$pedantic 42#end woogie! 43-- 44 45should be 46 47-- 48pedantic 49 woogie! 50-- 51 522) Whitespace will be eaten if there is a following newline 53 54-- 55#if ($pedantic) 56$pedantic 57#end 58-- 59 60should be 61 62-- 63pedantic 64-- 65 66 67-- INLINE STUFF --- 68 691) respect spaces in the block 70>#foreach($a in $stringarray)$a#end< 71>#foreach($a in $stringarray) $a#end< 72>#foreach($a in $stringarray)$a #end< 73>#foreach($a in $stringarray) $a #end< 74 752) set statement has no output, incuding preceeding whitespace 76#foreach($a in $stringarray) 77 #set($b = $a) 78 $a is $b 79#end 80 81 public void foo( String lala ) 82 { 83#foreach($a in $stringarray) 84 #set($b = $a) 85 System.out.println("$b"); 86#end 87 } 88 89 public void foo( String lala ) 90 { 91 #foreach($a in $stringarray) 92 #set($b = $a) 93 System.out.println("$b"); 94 #end 95 } 96 97Inline set statement : 98 99Here are the prices :#set( $arr = ["$10.24","$15.32","$12.15"] ) #foreach($a in $arr) $a #end 100 101 102