diff --git a/icu4c/source/test/intltest/numfmtst.cpp b/icu4c/source/test/intltest/numfmtst.cpp index 7e54a18992..1a047e4299 100644 --- a/icu4c/source/test/intltest/numfmtst.cpp +++ b/icu4c/source/test/intltest/numfmtst.cpp @@ -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 */ diff --git a/icu4c/source/test/intltest/numfmtst.h b/icu4c/source/test/intltest/numfmtst.h index 925a1c3d22..d675d1461b 100644 --- a/icu4c/source/test/intltest/numfmtst.h +++ b/icu4c/source/test/intltest/numfmtst.h @@ -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);