aboutsummaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2017-09-10 02:55:50 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2017-09-10 02:55:50 +0000
commit7f3beb13c50bce5848da35e286b0149253bea190 (patch)
tree6327a405644126a0c2b62cb2cd67b61d51abaa3d /src/test
parent392dfba3ef4ec2151ba9ac6772a3361d7b4e65f3 (diff)
downloadjackcess-7f3beb13c50bce5848da35e286b0149253bea190.tar.gz
jackcess-7f3beb13c50bce5848da35e286b0149253bea190.zip
fix some cast functions; more unit tests
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/exprs@1115 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java17
1 files changed, 17 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 0e2e85e..493795f 100644
--- a/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java
+++ b/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java
@@ -16,6 +16,7 @@ limitations under the License.
package com.healthmarketscience.jackcess.impl.expr;
+import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -49,6 +50,22 @@ public class DefaultFunctionsTest extends TestCase
assertEquals("f", eval("=Chr(102)"));
assertEquals("\u263A", eval("=ChrW(9786)"));
assertEquals("263A", eval("=Hex(9786)"));
+
+ assertEquals("blah", eval("=Nz(\"blah\")"));
+ assertEquals("", eval("=Nz(Null)"));
+ assertEquals("blah", eval("=Nz(\"blah\",\"FOO\")"));
+ assertEquals("FOO", eval("=Nz(Null,\"FOO\")"));
+
+ assertEquals("23072", eval("=Oct(9786)"));
+ assertEquals(" 9786", eval("=Str(9786)"));
+ assertEquals("-42", eval("=Str(-42)"));
+
+ assertEquals(-1L, eval("=CBool(\"1\")"));
+ assertEquals(13L, eval("=CByte(\"13\")"));
+ assertEquals(14L, eval("=CByte(\"13.7\")"));
+ assertEquals(new BigDecimal("57.1235"), eval("=CCur(\"57.12346\")"));
+ assertEquals(new Double("57.12345"), eval("=CDbl(\"57.12345\")"));
+
}
}