diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java | 14 | ||||
-rw-r--r-- | src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java | 4 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java b/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java index ca1a67c..e8aa234 100644 --- a/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java @@ -80,7 +80,21 @@ public class DefaultFunctionsTest extends TestCase assertEquals("-42", eval("=CStr(-42)")); assertEquals(-1, eval("=IsNull(Null)")); + assertEquals(0, eval("=IsNull(13)")); assertEquals(-1, eval("=IsDate(#01/02/2003#)")); + assertEquals(0, eval("=IsDate('foo')")); + + assertEquals(0, eval("=IsNumeric(Null)")); + assertEquals(0, eval("=IsNumeric('foo')")); + assertEquals(0, eval("=IsNumeric(#01/02/2003#)")); + assertEquals(-1, eval("=IsNumeric(37)")); + assertEquals(-1, eval("=IsNumeric(' 37 ')")); + assertEquals(-1, eval("=IsNumeric(' -37.5e2 ')")); + assertEquals(-1, eval("=IsNumeric(' &H37 ')")); + assertEquals(0, eval("=IsNumeric(' &H37foo ')")); + assertEquals(0, eval("=IsNumeric(' &o39 ')")); + assertEquals(-1, eval("=IsNumeric(' &o36 ')")); + assertEquals(0, eval("=IsNumeric(' &o36.1 ')")); assertEquals(1, eval("=VarType(Null)")); assertEquals(8, eval("=VarType('blah')")); 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 188172d..5b623a0 100644 --- a/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java +++ b/src/test/java/com/healthmarketscience/jackcess/impl/expr/ExpressionatorTest.java @@ -383,6 +383,10 @@ public class ExpressionatorTest extends TestCase assertEquals(37d, eval("=\"25\" + 12")); assertEquals(37d, eval("=12 + \"25\"")); + assertEquals(37d, eval("=\" 25 \" + 12")); + assertEquals(37d, eval("=\" &h1A \" + 11")); + assertEquals(37d, eval("=\" &h1a \" + 11")); + assertEquals(37d, eval("=\" &O32 \" + 11")); evalFail(("=12 - \"foo\""), RuntimeException.class); evalFail(("=\"foo\" - 12"), RuntimeException.class); |