From c84a6dd569f527b26e8f6a6398d3d5972d04b450 Mon Sep 17 00:00:00 2001 From: James Ahlborn Date: Sat, 14 Oct 2017 19:11:26 +0000 Subject: more math unit tests git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/exprs@1128 f203690c-595d-4dc9-a70b-905162fa7fd2 --- .../jackcess/impl/expr/ExpressionatorTest.java | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src') diff --git a/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java b/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java index 6463106..c6bda5b 100644 --- a/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java @@ -263,11 +263,22 @@ public class ExpressionatorTest extends TestCase } } } + } + public void testTrickyMathExpressions() throws Exception + { assertEquals(37, eval("=30+7")); assertEquals(23, eval("=30+-7")); assertEquals(23, eval("=30-+7")); + assertEquals(37, eval("=30--7")); assertEquals(23, eval("=30-7")); + + assertEquals(100, eval("=-10^2")); + assertEquals(-100, eval("=-(10)^2")); + assertEquals(-100, eval("=-\"10\"^2")); + + assertEquals(99d, eval("=-10E-1+10e+1")); + assertEquals(-101d, eval("=-10E-1-10e+1")); } public void testTypeCoercion() throws Exception -- cgit v1.2.3