Index: source/test/intltest/measfmttest.cpp |
diff --git a/source/test/intltest/measfmttest.cpp b/source/test/intltest/measfmttest.cpp |
index f2f2d09734c8f2a0885eb6fef16d5195e0960eff..4732f612fa8c331beb571dd2596a6fc91a94cbf4 100644 |
--- a/source/test/intltest/measfmttest.cpp |
+++ b/source/test/intltest/measfmttest.cpp |
@@ -61,6 +61,7 @@ private: |
void TestGroupingSeparator(); |
void TestDoubleZero(); |
void TestUnitPerUnitResolution(); |
+ void TestIndividualPluralFallback(); |
void verifyFormat( |
const char *description, |
const MeasureFormat &fmt, |
@@ -141,6 +142,7 @@ void MeasureFormatTest::runIndexedTest( |
TESTCASE_AUTO(TestGroupingSeparator); |
TESTCASE_AUTO(TestDoubleZero); |
TESTCASE_AUTO(TestUnitPerUnitResolution); |
+ TESTCASE_AUTO(TestIndividualPluralFallback); |
TESTCASE_AUTO_END; |
} |
@@ -1588,6 +1590,19 @@ void MeasureFormatTest::TestUnitPerUnitResolution() { |
assertEquals("", "50 psi", actual); |
} |
+void MeasureFormatTest::TestIndividualPluralFallback() { |
+ // See ticket #11986 "incomplete fallback in MeasureFormat". |
+ // In CLDR 28, fr_CA temperature-generic/short has only the "one" form, |
+ // and falls back to fr for the "other" form. |
+ IcuTestErrorCode errorCode(*this, "TestIndividualPluralFallback"); |
+ MeasureFormat mf("fr_CA", UMEASFMT_WIDTH_SHORT, errorCode); |
+ LocalPointer<Measure> twoDeg( |
+ new Measure(2, MeasureUnit::createGenericTemperature(errorCode), errorCode), errorCode); |
+ UnicodeString expected = UNICODE_STRING_SIMPLE("2\\u00B0").unescape(); |
+ UnicodeString actual; |
+ assertEquals("2 deg temp in fr_CA", expected, mf.format(twoDeg.orphan(), actual, errorCode)); |
+} |
+ |
void MeasureFormatTest::verifyFieldPosition( |
const char *description, |
const MeasureFormat &fmt, |