diff options
-rw-r--r-- | src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java | 11 |
1 files changed, 11 insertions, 0 deletions
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 |