summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2017-10-17 12:32:09 +0200
committerEike Rathke <erack@redhat.com>2017-10-17 12:35:09 +0200
commitd1538ef63863f7a016bd2c3752ccdd9819e41781 (patch)
tree0a7df4c7498cdd3009dda38aafff6c5582e52b61 /svl
parent0f50f4d91809c65b50da087a84fb7b8722fda3f9 (diff)
More tests for time and date+time fractions of seconds, tdf#112933 related
Covering the loop and non-loop states in ImpSvNumberformatScan::FinalScan() Change-Id: I4a8da617a2a61ad12a99462bfe4014aaa5a75c1b
Diffstat (limited to 'svl')
-rw-r--r--svl/qa/unit/svl.cxx19
1 files changed, 19 insertions, 0 deletions
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index 43824e4d8c71..a8ebfbc281aa 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -1311,6 +1311,25 @@ void Test::testUserDefinedNumberFormats()
sCode = "MM:SS.0";
sExpected = "23:53.6";
checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected);
+ // Two decimals.
+ sCode = "MM:SS.00";
+ sExpected = "23:53.61";
+ checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected);
+ // Three decimals.
+ sCode = "MM:SS.000";
+ sExpected = "23:53.605";
+ checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected);
+
+ // Same with date+time.
+ sCode = "YYYY-MM-DD MM:SS.0";
+ sExpected = "1900-01-02 23:53.6";
+ checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected);
+ sCode = "YYYY-MM-DD MM:SS.00";
+ sExpected = "1900-01-02 23:53.61";
+ checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected);
+ sCode = "YYYY-MM-DD MM:SS.000";
+ sExpected = "1900-01-02 23:53.605";
+ checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected);
}
}