ICU-11640 Add test for triple currency digit prefix.

X-SVN-Rev: 41412
This commit is contained in:
Norbert Runge 2018-05-18 20:17:33 +00:00
parent 23645f081b
commit 2627d76fbe
2 changed files with 17 additions and 0 deletions

View File

@ -211,6 +211,7 @@ void NumberFormatTest::runIndexedTest( int32_t index, UBool exec, const char* &n
TESTCASE_AUTO(Test11647_PatternCurrencySymbols);
TESTCASE_AUTO(Test11913_BigDecimal);
TESTCASE_AUTO(Test11020_RoundingInScientificNotation);
TESTCASE_AUTO(Test11640_TripleCurrencySymbol);
TESTCASE_AUTO_END;
}
@ -9025,4 +9026,19 @@ void NumberFormatTest::Test11020_RoundingInScientificNotation() {
fmt.format(12301.2, result);
assertEquals("Rounding increment should be applied after magnitude scaling", u"1,25E4", result);
}
void NumberFormatTest::Test11640_TripleCurrencySymbol() {
IcuTestErrorCode status(*this, "PercentageRounding");
UnicodeString actual;
DecimalFormat *dFormat = new DecimalFormat("¤¤¤ 0", status);
if (U_FAILURE(status)) {
dataerrln("Failure creating DecimalFormat %s", u_errorName(status));
return;
}
dFormat->setCurrency(u"USD");
UnicodeString result;
dFormat->getPositivePrefix(result);
assertEquals("Tryple-currency should give long name on getPositivePrefix",
"US dollars ", result);
}
#endif /* #if !UCONFIG_NO_FORMATTING */

View File

@ -275,6 +275,7 @@ class NumberFormatTest: public CalendarTimeZoneTest {
void Test11647_PatternCurrencySymbols();
void Test11913_BigDecimal();
void Test11020_RoundingInScientificNotation();
void Test11640_TripleCurrencySymbol();
private:
UBool testFormattableAsUFormattable(const char *file, int line, Formattable &f);