ICU-11648 Re-add test for DecimalFormat::toPattern

X-SVN-Rev: 41346
This commit is contained in:
Craig Cornelius 2018-05-07 23:29:05 +00:00
parent 614a3441db
commit aeaeb8397b
2 changed files with 15 additions and 0 deletions

View File

@ -672,6 +672,7 @@ void NumberFormatTest::runIndexedTest( int32_t index, UBool exec, const char* &n
TESTCASE_AUTO(Test11645_ApplyPatternEquality);
TESTCASE_AUTO(Test12567);
TESTCASE_AUTO(Test13056_GroupingSize);
TESTCASE_AUTO(Test11648_ExpDecFormatMalPattern);
TESTCASE_AUTO_END;
}
@ -9396,4 +9397,17 @@ void NumberFormatTest::Test13056_GroupingSize() {
assertEquals("Secondary should remember explicit setting and return 3", 3, df.getSecondaryGroupingSize());
}
void NumberFormatTest::Test11648_ExpDecFormatMalPattern() {
UErrorCode status = U_ZERO_ERROR;
DecimalFormat fmt("0.00", status);
fmt.setScientificNotation(TRUE);
UnicodeString pattern;
assertEquals("", "0.00E0", fmt.toPattern(pattern));
DecimalFormat fmt2(pattern, status);
assertSuccess("", status);
}
#endif /* #if !UCONFIG_NO_FORMATTING */

View File

@ -237,6 +237,7 @@ class NumberFormatTest: public CalendarTimeZoneTest {
void Test11645_ApplyPatternEquality();
void Test12567();
void Test13056_GroupingSize();
void Test11648_ExpDecFormatMalPattern();
private:
UBool testFormattableAsUFormattable(const char *file, int line, Formattable &f);