mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-11739 Adding ICU4C test for parse long currency.
X-SVN-Rev: 41334
This commit is contained in:
parent
076cee9ad6
commit
66510b153f
2 changed files with 13 additions and 0 deletions
|
@ -647,6 +647,7 @@ void NumberFormatTest::runIndexedTest( int32_t index, UBool exec, const char* &n
|
|||
TESTCASE_AUTO(TestFractionalDigitsForCurrency);
|
||||
TESTCASE_AUTO(TestFormatCurrencyPlural);
|
||||
TESTCASE_AUTO(Test11868);
|
||||
TESTCASE_AUTO(Test11739_ParseLongCurrency);
|
||||
TESTCASE_AUTO(Test10727_RoundingZero);
|
||||
TESTCASE_AUTO(Test11376_getAndSetPositivePrefix);
|
||||
TESTCASE_AUTO(Test11475_signRecognition);
|
||||
|
@ -8748,6 +8749,17 @@ void NumberFormatTest::Test10727_RoundingZero() {
|
|||
assertTrue("", dq.isNegative());
|
||||
}
|
||||
|
||||
void NumberFormatTest::Test11739_ParseLongCurrency() {
|
||||
IcuTestErrorCode status(*this, "Test11739_ParseLongCurrency");
|
||||
LocalPointer<NumberFormat> nf(NumberFormat::createCurrencyInstance("sr_BA", status));
|
||||
((DecimalFormat*) nf.getAlias())->applyPattern(u"#,##0.0 ¤¤¤", status);
|
||||
ParsePosition ppos(0);
|
||||
CurrencyAmount* result = nf->parseCurrency(u"1.500 амерички долар", ppos);
|
||||
assertEquals("Should parse to 1500 USD", -1, ppos.getErrorIndex());
|
||||
assertEquals("Should parse to 1500 USD", 1500LL, result->getNumber().getInt64(status));
|
||||
assertEquals("Should parse to 1500 USD", u"USD", result->getISOCurrency());
|
||||
}
|
||||
|
||||
void NumberFormatTest::Test11376_getAndSetPositivePrefix() {
|
||||
{
|
||||
const UChar USD[] = {0x55, 0x53, 0x44, 0x0};
|
||||
|
|
|
@ -211,6 +211,7 @@ class NumberFormatTest: public CalendarTimeZoneTest {
|
|||
void TestFractionalDigitsForCurrency();
|
||||
void TestFormatCurrencyPlural();
|
||||
void Test11868();
|
||||
void Test11739_ParseLongCurrency();
|
||||
void Test10727_RoundingZero();
|
||||
void Test11376_getAndSetPositivePrefix();
|
||||
void Test11475_signRecognition();
|
||||
|
|
Loading…
Add table
Reference in a new issue