aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/java/com
diff options
context:
space:
mode:
authorJames Ahlborn <jtahlborn@yahoo.com>2019-01-31 01:28:39 +0000
committerJames Ahlborn <jtahlborn@yahoo.com>2019-01-31 01:28:39 +0000
commitb2bb4fcdba54b5ecf5d9cbc56f2d3e0fca3326ef (patch)
tree785be75ef5c4a21c78f8b3231e0643e21f1ecdea /src/test/java/com
parent229464aff25cee0ff6941174fefd4e3416800f9f (diff)
downloadjackcess-b2bb4fcdba54b5ecf5d9cbc56f2d3e0fca3326ef.tar.gz
jackcess-b2bb4fcdba54b5ecf5d9cbc56f2d3e0fca3326ef.zip
more tests and tweaks to custom formatting
git-svn-id: https://svn.code.sf.net/p/jackcess/code/jackcess/branches/jdk8@1271 f203690c-595d-4dc9-a70b-905162fa7fd2
Diffstat (limited to 'src/test/java/com')
-rw-r--r--src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java11
1 files changed, 10 insertions, 1 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 7275fb2..b25f150 100644
--- a/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java
+++ b/src/test/java/com/healthmarketscience/jackcess/impl/expr/DefaultFunctionsTest.java
@@ -333,6 +333,7 @@ public class DefaultFunctionsTest extends TestCase
public void testCustomFormat() throws Exception
{
assertEval("07:00 a", "=Format(#01/10/2003 7:00:00 AM#, 'hh:nn a/p')");
+ assertEval("07:00 p", "=Format(#01/10/2003 7:00:00 PM#, 'hh:nn a/p')");
assertEval("07:00 a 6 2", "=Format(#01/10/2003 7:00:00 AM#, 'hh:nn a/p w ww')");
assertEval("07:00 a 4 1", "=Format(#01/10/2003 7:00:00 AM#, 'hh:nn a/p w ww', 3, 3)");
assertEval("1313", "=Format(#01/10/2003 7:13:00 AM#, 'nnnn; foo bar')");
@@ -349,6 +350,8 @@ public class DefaultFunctionsTest extends TestCase
"=Format('3.9', 'dddd, yy mmm mm/d, hh:nn:ss AMPM')");
assertEval("9:36:00 PM",
"=Format('3.9', 'ttttt')");
+ assertEval("9:36:00 PM",
+ "=Format(3.9, 'ttttt')");
assertEval("foo",
"=Format('foo', 'dddd, yy mmm mm d, hh:nn:ss AMPM')");
@@ -359,11 +362,12 @@ public class DefaultFunctionsTest extends TestCase
"n", "'0'",
"", "Null");
- assertEvalFormat("';\"y\";!\\n;*~\\z[Blue];'",
+ assertEvalFormat("'\\p;\"y\";!\\n;*~\\z[Blue];'",
"foo", "'foo'",
"", "''",
"y", "True",
"n", "'0'",
+ "p", "'10'",
"z", "Null");
assertEvalFormat("'\"p\"#.00#\"blah\"'",
@@ -475,6 +479,11 @@ public class DefaultFunctionsTest extends TestCase
// "", "0"
);
+ assertEvalFormat("\"#;n'g;'\"",
+ "5", "5",
+ "n'g", "-5",
+ "'", "0");
+
assertEvalFormat("'$0.0#'",
"$213.0", "213");