geirm 00/12/27 06:48:50
Modified: test/templates math.vm
test/templates/compare math.cmp
Log:
Added test for negative numbers in math.
Revision Changes Path
1.2 +4 -0 jakarta-velocity/test/templates/math.vm
Index: math.vm
===================================================================
RCS file: /home/cvs/jakarta-velocity/test/templates/math.vm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- math.vm 2000/12/27 14:29:07 1.1
+++ math.vm 2000/12/27 14:48:48 1.2
@@ -29,6 +29,10 @@
$bar / 0 = #set($rem4 = $bar / 0 )$rem4
$bar * 2 = #set($rem = $bar * 2 )$rem
+$bar * -1 = #set($rem = $bar * -1)$rem
+$bar * -2 = #set($rem = $bar *-2)$rem
+$bar * -2 = #set($rem = -2*$bar)$rem
+
And now null nodes to make sure it doesn't throw an NPE :
#set($flargh=$woogie + $wabbie)
1.2 +4 -0 jakarta-velocity/test/templates/compare/math.cmp
Index: math.cmp
===================================================================
RCS file: /home/cvs/jakarta-velocity/test/templates/compare/math.cmp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- math.cmp 2000/12/27 14:29:08 1.1
+++ math.cmp 2000/12/27 14:48:49 1.2
@@ -12,5 +12,9 @@
5 / 0 = $rem4
5 * 2 = 10
+5 * -1 = -5
+5 * -2 = -10
+5 * -2 = -10
+
And now null nodes to make sure it doesn't throw an NPE :