mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-13777 Adding tests to make sure currency long names round-trip through parsing.
X-SVN-Rev: 41446
This commit is contained in:
parent
68b2d740d6
commit
58b7fe2e32
3 changed files with 17 additions and 0 deletions
|
@ -213,6 +213,7 @@ void NumberFormatTest::runIndexedTest( int32_t index, UBool exec, const char* &n
|
|||
TESTCASE_AUTO(Test11020_RoundingInScientificNotation);
|
||||
TESTCASE_AUTO(Test11640_TripleCurrencySymbol);
|
||||
TESTCASE_AUTO(Test13763_FieldPositionIteratorOffset);
|
||||
TESTCASE_AUTO(Test13777_ParseLongNameNonCurrencyMode);
|
||||
TESTCASE_AUTO_END;
|
||||
}
|
||||
|
||||
|
@ -9067,4 +9068,12 @@ void NumberFormatTest::Test13763_FieldPositionIteratorOffset() {
|
|||
expectPositions(fpi, expected, tupleCount, result);
|
||||
}
|
||||
|
||||
void NumberFormatTest::Test13777_ParseLongNameNonCurrencyMode() {
|
||||
IcuTestErrorCode status(*this, "Test13777_ParseLongNameNonCurrencyMode");
|
||||
|
||||
LocalPointer<NumberFormat> df(
|
||||
NumberFormat::createInstance("en-us", UNumberFormatStyle::UNUM_CURRENCY_PLURAL, status));
|
||||
expect2(*df, 1.5, u"1.50 US dollars");
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
|
|
@ -277,6 +277,7 @@ class NumberFormatTest: public CalendarTimeZoneTest {
|
|||
void Test11020_RoundingInScientificNotation();
|
||||
void Test11640_TripleCurrencySymbol();
|
||||
void Test13763_FieldPositionIteratorOffset();
|
||||
void Test13777_ParseLongNameNonCurrencyMode();
|
||||
|
||||
private:
|
||||
UBool testFormattableAsUFormattable(const char *file, int line, Formattable &f);
|
||||
|
|
|
@ -6154,4 +6154,11 @@ public class NumberFormatTest extends TestFmwk {
|
|||
df.applyLocalizedPattern("c0!d0"); // should not throw
|
||||
assertEquals("should apply the localized pattern", df.getNegativePrefix(), "d");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test13777_ParseLongNameNonCurrencyMode() {
|
||||
// Currency long name should round-trip even when non-currency parsing is used.
|
||||
NumberFormat df = NumberFormat.getInstance(ULocale.US, NumberFormat.PLURALCURRENCYSTYLE);
|
||||
expect2(df, 1.5, "1.50 US dollars");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue