mirror of
https://github.com/unicode-org/icu.git
synced 2025-04-07 22:44:49 +00:00
ICU-13056 NumberFormatTest Test GroupingSize
X-SVN-Rev: 41343
This commit is contained in:
parent
553882f580
commit
1e375dbbcc
2 changed files with 16 additions and 0 deletions
|
@ -671,6 +671,7 @@ void NumberFormatTest::runIndexedTest( int32_t index, UBool exec, const char* &n
|
|||
TESTCASE_AUTO(Test10354);
|
||||
TESTCASE_AUTO(Test11645_ApplyPatternEquality);
|
||||
TESTCASE_AUTO(Test11648_ExpDecFormatMalPattern);
|
||||
TESTCASE_AUTO(Test13056_GroupingSize);
|
||||
TESTCASE_AUTO_END;
|
||||
}
|
||||
|
||||
|
@ -9375,4 +9376,18 @@ void NumberFormatTest::Test11648_ExpDecFormatMalPattern() {
|
|||
assertSuccess("", status);
|
||||
}
|
||||
|
||||
void NumberFormatTest::Test13056_GroupingSize() {
|
||||
UErrorCode status = U_ZERO_ERROR;
|
||||
DecimalFormat df(u"#,##0", status);
|
||||
if (!assertSuccess("", status)) return;
|
||||
assertEquals("Primary grouping should return 3", 3, df.getGroupingSize());
|
||||
assertEquals("Secondary grouping should return 0", 0, df.getSecondaryGroupingSize());
|
||||
df.setSecondaryGroupingSize(3);
|
||||
assertEquals("Primary grouping should still return 3", 3, df.getGroupingSize());
|
||||
assertEquals("Secondary grouping should round-trip", 3, df.getSecondaryGroupingSize());
|
||||
df.setGroupingSize(4);
|
||||
assertEquals("Primary grouping should return 4", 4, df.getGroupingSize());
|
||||
assertEquals("Secondary should remember explicit setting and return 3", 3, df.getSecondaryGroupingSize());
|
||||
}
|
||||
|
||||
#endif /* #if !UCONFIG_NO_FORMATTING */
|
||||
|
|
|
@ -236,6 +236,7 @@ class NumberFormatTest: public CalendarTimeZoneTest {
|
|||
void Test10354();
|
||||
void Test11645_ApplyPatternEquality();
|
||||
void Test11648_ExpDecFormatMalPattern();
|
||||
void Test13056_GroupingSize();
|
||||
|
||||
private:
|
||||
UBool testFormattableAsUFormattable(const char *file, int line, Formattable &f);
|
||||
|
|
Loading…
Add table
Reference in a new issue