Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ICU-22885 Add test to show the problem of DecimalFormat #3155

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions icu4c/source/test/intltest/numfmtst.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ void NumberFormatTest::runIndexedTest( int32_t index, UBool exec, const char* &n
TESTCASE_AUTO(TestFormatAttributes);
TESTCASE_AUTO(TestFieldPositionIterator);
TESTCASE_AUTO(TestDecimal);
TESTCASE_AUTO(TestDecimalFormatParse7E);
TESTCASE_AUTO(TestCurrencyFractionDigits);
TESTCASE_AUTO(TestExponentParse);
TESTCASE_AUTO(TestExplicitParents);
Expand Down Expand Up @@ -6979,6 +6980,15 @@ void NumberFormatTest::TestDecimal() {
#endif

}
void NumberFormatTest::TestDecimalFormatParse7E() {
UErrorCode status = U_ZERO_ERROR;
UnicodeString testdata = u"~";
icu::Formattable result;
icu::DecimalFormat dfmt(testdata, status);
if (U_SUCCESS(status)) {
dfmt.parse(testdata, result, status);
}
}

void NumberFormatTest::TestCurrencyFractionDigits() {
UErrorCode status = U_ZERO_ERROR;
Expand Down
1 change: 1 addition & 0 deletions icu4c/source/test/intltest/numfmtst.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class NumberFormatTest: public CalendarTimeZoneTest {
void TestLenientParse();

void TestDecimal();
void TestDecimalFormatParse7E();
void TestCurrencyFractionDigits();

void TestExponentParse();
Expand Down
Loading