Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: source/test/intltest/measfmttest.cpp

Issue 1621943002: ICU 56 step 4: Apply post-56 fixes for measure/date format (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@56goog
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/test/intltest/itutil.cpp ('k') | source/test/intltest/quantityformattertest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « source/test/intltest/itutil.cpp ('k') | source/test/intltest/quantityformattertest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698