diff options
author | Laurent Balland-Poirier <laurent.balland-poirier@laposte.net> | 2016-05-29 08:07:41 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-05-30 22:52:00 +0000 |
commit | 93874236610dd50a46b6db229e022ae364af582a (patch) | |
tree | b489e1dfa22b582d9cfd129652c1450ed4da8c14 /svl/qa/unit | |
parent | a3471916370c53c6627ba4010489f539c174bdf9 (diff) |
tdf#97835: suppress decimal separator
tdf#61996: skip quoted text
tdf#95339: detect SSMM as seconds minutes
Change-Id: Iee3ff723b0c5d2a298d8c7ef03112d5e30d4e4df
Reviewed-on: https://gerrit.libreoffice.org/25597
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'svl/qa/unit')
-rw-r--r-- | svl/qa/unit/svl.cxx | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx index 7f4c1e875381..ece214b3eb55 100644 --- a/svl/qa/unit/svl.cxx +++ b/svl/qa/unit/svl.cxx @@ -31,6 +31,8 @@ #include <i18nlangtag/lang.h> +#include <math.h> + #include <svl/zforlist.hxx> #include <svl/zformat.hxx> #include <svl/sharedstringpool.hxx> @@ -60,6 +62,7 @@ public: void testI116701(); void testDateInput(); void testIsNumberFormat(); + void testUserDefinedNumberFormats(); CPPUNIT_TEST_SUITE(Test); CPPUNIT_TEST(testNumberFormat); @@ -70,6 +73,7 @@ public: CPPUNIT_TEST(testI116701); CPPUNIT_TEST(testDateInput); CPPUNIT_TEST(testIsNumberFormat); + CPPUNIT_TEST(testUserDefinedNumberFormats); CPPUNIT_TEST_SUITE_END(); private: @@ -1080,6 +1084,28 @@ void Test::testIsNumberFormat() } } +void Test::testUserDefinedNumberFormats() +{ + LanguageType eLang = LANGUAGE_ENGLISH_US; + OUString sCode, sExpected; + SvNumberFormatter aFormatter(m_xContext, eLang); + { // tdf#97835: suppress decimal separator + sCode = "0.##\" m\""; + sExpected = "12 m"; + checkPreviewString(aFormatter, sCode, 12.0, eLang, sExpected); + } + { // tdf#61996: skip quoted text + sCode = "0.00\" ;\""; + sExpected = "-12.00 ;"; + checkPreviewString(aFormatter, sCode, -12.0, eLang, sExpected); + } + { // tdf#995339: detect SSMM as second minute + sCode = "SS:MM:HH DD/MM/YY"; + sExpected = "54:23:03 02/01/00"; + checkPreviewString(aFormatter, sCode, M_PI, eLang, sExpected); + } +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); } |