geirm 00/12/09 21:01:07
Added: test/templates vm_test1.vm vm_test2.vm
Log:
New tests for recursion and template-local inline VMs.
Revision Changes Path
1.1 jakarta-velocity/test/templates/vm_test1.vm
Index: vm_test1.vm
===================================================================
#**
@test vm_test1.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.
Tests VM recursion. In our VM library, we have a VM callrecurse()
which calls recurse(). The point is to have the global def of
recurse() called since we don't define it here.
*#
#callrecurse()
1.1 jakarta-velocity/test/templates/vm_test2.vm
Index: vm_test2.vm
===================================================================
#**
@test vm_test2.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.
Tests VM recursion *and* the local template namespace feature.
This version of recurse should override the global version
when called by the global VM callrecurse()
*#
#macro( recurse $a )
local recurse $a
#set( $a = $a - 1)
#if ($a > 0)
#recurse( $a )
#end
#end
#set($count = 5)
#callrecurse()