aboutsummaryrefslogtreecommitdiff
path: root/velocity-engine-core/src/test/resources
diff options
context:
space:
mode:
authorClaude Brisson <cbrisson@apache.org>2019-02-26 16:20:09 +0000
committerClaude Brisson <cbrisson@apache.org>2019-02-26 16:20:09 +0000
commit9287e510ebb92adf9760cb48cdfc46e4e62b1902 (patch)
tree1790342692abca29c0df6804089c3cbba9421f83 /velocity-engine-core/src/test/resources
parent8d9f910e2331754dfea2c51964850b065366190d (diff)
downloadapache-velocity-engine-9287e510ebb92adf9760cb48cdfc46e4e62b1902.tar.gz
[engine] Fix unary negate
git-svn-id: https://svn.apache.org/repos/asf/velocity/engine/trunk@1854404 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'velocity-engine-core/src/test/resources')
-rw-r--r--velocity-engine-core/src/test/resources/templates/compare/math.cmp5
-rw-r--r--velocity-engine-core/src/test/resources/templates/math.vm11
2 files changed, 14 insertions, 2 deletions
diff --git a/velocity-engine-core/src/test/resources/templates/compare/math.cmp b/velocity-engine-core/src/test/resources/templates/compare/math.cmp
index e3c99515..c2eee4e7 100644
--- a/velocity-engine-core/src/test/resources/templates/compare/math.cmp
+++ b/velocity-engine-core/src/test/resources/templates/compare/math.cmp
@@ -41,4 +41,7 @@ Test integer division
Test decimal division
5 / 2.0 = 2.5
-5.0 / 2 = 2.5 \ No newline at end of file
+5.0 / 2 = 2.5
+
+Unary negate
+-5 = -5 = -5 = -5 = -5 = -5
diff --git a/velocity-engine-core/src/test/resources/templates/math.vm b/velocity-engine-core/src/test/resources/templates/math.vm
index 3f336eac..e0e8e816 100644
--- a/velocity-engine-core/src/test/resources/templates/math.vm
+++ b/velocity-engine-core/src/test/resources/templates/math.vm
@@ -59,4 +59,13 @@ Test integer division
Test decimal division
5 / 2.0 = #set($result = 5 / 2.0)$result
-5.0 / 2 = #set($result = 5.0 / 2)$result \ No newline at end of file
+5.0 / 2 = #set($result = 5.0 / 2)$result
+
+Unary negate
+#set($five = 5)
+#set($a = 0 - $five)
+#set($b = 0-$five)
+#set($c = - $five)
+#set($d = -$five)
+#set($e =-$five)
+-5 = $a = $b = $c = $d = $e