mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-14 17:24:01 +00:00
ICU-13035 Adding test to ICU4C for padding code point.
X-SVN-Rev: 41339
This commit is contained in:
parent
8f7040d418
commit
cc5fca2744
3 changed files with 18 additions and 0 deletions
|
@ -29,6 +29,7 @@ addPaddingHelper(UChar32 paddingCp, int32_t requiredPadding, NumberStringBuilder
|
|||
}
|
||||
|
||||
Padder::Padder(UChar32 cp, int32_t width, UNumberFormatPadPosition position) : fWidth(width) {
|
||||
// TODO(13034): Consider making this a string instead of code point.
|
||||
fUnion.padding.fCp = cp;
|
||||
fUnion.padding.fPosition = position;
|
||||
}
|
||||
|
|
|
@ -648,6 +648,7 @@ void NumberFormatTest::runIndexedTest( int32_t index, UBool exec, const char* &n
|
|||
TESTCASE_AUTO(TestFormatCurrencyPlural);
|
||||
TESTCASE_AUTO(Test11868);
|
||||
TESTCASE_AUTO(Test11739_ParseLongCurrency);
|
||||
TESTCASE_AUTO(Test13035_MultiCodePointPaddingInPattern);
|
||||
TESTCASE_AUTO(Test10727_RoundingZero);
|
||||
TESTCASE_AUTO(Test11376_getAndSetPositivePrefix);
|
||||
TESTCASE_AUTO(Test11475_signRecognition);
|
||||
|
@ -8763,6 +8764,21 @@ void NumberFormatTest::Test11739_ParseLongCurrency() {
|
|||
assertEquals("Should parse to 1500 USD", u"USD", result->getISOCurrency());
|
||||
}
|
||||
|
||||
void NumberFormatTest::Test13035_MultiCodePointPaddingInPattern() {
|
||||
IcuTestErrorCode status(*this, "Test13035_MultiCodePointPaddingInPattern");
|
||||
DecimalFormat df(u"a*'நி'###0b", status);
|
||||
UnicodeString result;
|
||||
df.format(12, result.remove());
|
||||
// TODO(13034): Re-enable this test when support is added in ICU4C.
|
||||
//assertEquals("Multi-codepoint padding should not be split", u"aநிநி12b", result);
|
||||
df = DecimalFormat(u"a*\U0001F601###0b", status);
|
||||
result = df.format(12, result.remove());
|
||||
assertEquals("Single-codepoint padding should not be split", u"a\U0001F601\U0001F60112b", result);
|
||||
df = DecimalFormat(u"a*''###0b", status);
|
||||
result = df.format(12, result.remove());
|
||||
assertEquals("Quote should be escapable in padding syntax", "a''12b", result);
|
||||
}
|
||||
|
||||
void NumberFormatTest::Test11376_getAndSetPositivePrefix() {
|
||||
{
|
||||
const UChar USD[] = {0x55, 0x53, 0x44, 0x0};
|
||||
|
|
|
@ -212,6 +212,7 @@ class NumberFormatTest: public CalendarTimeZoneTest {
|
|||
void TestFormatCurrencyPlural();
|
||||
void Test11868();
|
||||
void Test11739_ParseLongCurrency();
|
||||
void Test13035_MultiCodePointPaddingInPattern();
|
||||
void Test10727_RoundingZero();
|
||||
void Test11376_getAndSetPositivePrefix();
|
||||
void Test11475_signRecognition();
|
||||
|
|
Loading…
Add table
Reference in a new issue