From 313feb8f8109fa9373f152605d977e02c1f702ef Mon Sep 17 00:00:00 2001 From: Peter Edberg Date: Tue, 2 Sep 2014 22:46:20 +0000 Subject: [PATCH] ICU-11173 CLDR tags/release-26-d01 into ICU4J trunk with related test & lib code updates X-SVN-Rev: 36311 --- .../src/com/ibm/icu/text/MeasureFormat.java | 14 +- .../src/com/ibm/icu/util/MeasureUnit.java | 3 + .../core/src/com/ibm/icu/util/Region.java | 7 +- icu4j/main/shared/data/icudata.jar | 4 +- icu4j/main/shared/data/icutzdata.jar | 2 +- icu4j/main/shared/data/testdata.jar | 4 +- .../com/ibm/icu/dev/data/collationtest.txt | 2 +- .../test/collator/CollationFinnishTest.java | 2 +- .../format/GlobalizationPreferencesTest.java | 4 +- .../dev/test/calendar/IBMCalendarTest.java | 16 +-- .../test/format/CompactDecimalFormatTest.java | 34 ++--- .../icu/dev/test/format/DateFormatTest.java | 65 +++++----- .../test/format/DateIntervalFormatTest.java | 16 +-- .../test/format/DateTimeGeneratorTest.java | 18 +-- .../icu/dev/test/format/MeasureUnitTest.java | 22 +++- .../icu/dev/test/format/NumberFormatTest.java | 30 +++-- .../icu/dev/test/format/NumberRegression.java | 5 +- .../icu/dev/test/format/PluralFormatTest.java | 6 +- .../icu/dev/test/format/PluralRangesTest.java | 2 +- .../format/RelativeDateTimeFormatterTest.java | 12 +- .../ibm/icu/dev/test/format/TimeUnitTest.java | 120 ++++++++++-------- .../ibm/icu/dev/test/util/CurrencyTest.java | 16 +-- .../dev/test/util/ICUResourceBundleTest.java | 7 +- .../ibm/icu/dev/test/util/ULocaleTest.java | 8 +- 24 files changed, 232 insertions(+), 187 deletions(-) diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/MeasureFormat.java b/icu4j/main/classes/core/src/com/ibm/icu/text/MeasureFormat.java index 9dd8c2d4204..4bbc5370e2d 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/text/MeasureFormat.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/text/MeasureFormat.java @@ -743,6 +743,7 @@ public class MeasureFormat extends UFormat { ICUResourceBundle unitsRes = unitTypeRes.getWithFallback(unit.getType()); ICUResourceBundle oneUnitRes = unitsRes.getWithFallback(unit.getSubtype()); builder.reset(); + boolean havePluralItem = false; int len = oneUnitRes.getSize(); for (int i = 0; i < len; i++) { UResourceBundle countBundle; @@ -751,9 +752,18 @@ public class MeasureFormat extends UFormat { } catch (MissingResourceException e) { continue; } - builder.add(countBundle.getKey(), countBundle.getString()); + String resKey = countBundle.getKey(); + if (resKey.equals("dnam") || resKey.equals("per")) { + continue; // skip display name & per pattern (new in CLDR 26 / ICU 54) for now, not part of plurals + } + havePluralItem = true; + builder.add(resKey, countBundle.getString()); + } + if (havePluralItem) { + // might not have any plural items if countBundle only has "dnam" display name, for instance, + // as with fr unitsNarrow/light/lux in CLDR 26 + styleToCountToFormat.put(styleItem, builder.build()); } - styleToCountToFormat.put(styleItem, builder.build()); } catch (MissingResourceException e) { continue; } diff --git a/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java b/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java index 00011c6f85c..84af828f66c 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/util/MeasureUnit.java @@ -250,6 +250,9 @@ public class MeasureUnit implements Serializable { for ( int index = 0; index < size; ++index) { UResourceBundle unitsRes = unitsTypeRes.get(index); String type = unitsRes.getKey(); + if (type.equals("compound")) { + continue; // special type, does not have any unit plurals + } int unitsSize = unitsRes.getSize(); for ( int index2 = 0; index2 < unitsSize; ++index2) { ICUResourceBundle unitNameRes = (ICUResourceBundle)unitsRes.get(index2); diff --git a/icu4j/main/classes/core/src/com/ibm/icu/util/Region.java b/icu4j/main/classes/core/src/com/ibm/icu/util/Region.java index 912e29fa0c3..a1ecd8c0850 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/util/Region.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/util/Region.java @@ -1,6 +1,6 @@ /* ******************************************************************************* - * Copyright (C) 2011-2013, International Business Machines Corporation * + * Copyright (C) 2011-2014, International Business Machines Corporation * * All Rights Reserved. * ******************************************************************************* */ @@ -287,8 +287,11 @@ public class Region implements Comparable { for ( int i = 0 ; i < territoryContainment.getSize(); i++ ) { UResourceBundle mapping = territoryContainment.get(i); String parent = mapping.getKey(); + if (parent.equals("containedGroupings") || parent.equals("deprecated")) { + continue; // handle new pseudo-parent types added in ICU data per cldrbug 7808; for now just skip. + // #11232 is to do something useful with these. + } Region parentRegion = regionIDMap.get(parent); - for ( int j = 0 ; j < mapping.getSize(); j++ ) { String child = mapping.getString(j); Region childRegion = regionIDMap.get(child); diff --git a/icu4j/main/shared/data/icudata.jar b/icu4j/main/shared/data/icudata.jar index 65be0ee2b28..6e94f3ea826 100755 --- a/icu4j/main/shared/data/icudata.jar +++ b/icu4j/main/shared/data/icudata.jar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d9376b857657eca50d15c4ebd947cda1bdd3ca04ea21b32212637077bc76bc35 -size 10647117 +oid sha256:d5cbfb37c1e0ded5119343a6cd6197f9871829d1d7905b7e3640c7cef48888a9 +size 11619243 diff --git a/icu4j/main/shared/data/icutzdata.jar b/icu4j/main/shared/data/icutzdata.jar index 96e4dfb14c3..abdc3b7c8ac 100755 --- a/icu4j/main/shared/data/icutzdata.jar +++ b/icu4j/main/shared/data/icutzdata.jar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a00bc9ad7b67fa9dc26154780ae858a1a5076e5188c95dbbe0f3ecb0c917694f +oid sha256:6b757901f2ea5ac23c11342bcb6292cdb97e9e039c7365a75af11531af28b38c size 90987 diff --git a/icu4j/main/shared/data/testdata.jar b/icu4j/main/shared/data/testdata.jar index aff13f15c58..bc825850239 100755 --- a/icu4j/main/shared/data/testdata.jar +++ b/icu4j/main/shared/data/testdata.jar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:dfe59dc5da94f13855ac8aa724c501fe111a96911e40b7a551324a40815dc56d -size 719346 +oid sha256:f9196c43d19e7c3be65a6e46cb3f08a6c8e7b4a41f7fe9d69cc1c00b2dd00267 +size 722060 diff --git a/icu4j/main/tests/collate/src/com/ibm/icu/dev/data/collationtest.txt b/icu4j/main/tests/collate/src/com/ibm/icu/dev/data/collationtest.txt index 5b14a77fae7..d55f5318889 100644 --- a/icu4j/main/tests/collate/src/com/ibm/icu/dev/data/collationtest.txt +++ b/icu4j/main/tests/collate/src/com/ibm/icu/dev/data/collationtest.txt @@ -1514,8 +1514,8 @@ < zy < ž < v -< w < va +< w < õ < õy < ä diff --git a/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationFinnishTest.java b/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationFinnishTest.java index 3870adfd395..89df9f7598d 100644 --- a/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationFinnishTest.java +++ b/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/collator/CollationFinnishTest.java @@ -44,7 +44,7 @@ public class CollationFinnishTest extends TestFmwk { 1, -1, // test primary > 4 - 0, //collation rules for finnish have changed! + 1, // v < w per cldrbug 6615 }; private Collator myCollation = null; diff --git a/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/format/GlobalizationPreferencesTest.java b/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/format/GlobalizationPreferencesTest.java index d711e34a9cb..686e8dfaa71 100644 --- a/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/format/GlobalizationPreferencesTest.java +++ b/icu4j/main/tests/collate/src/com/ibm/icu/dev/test/format/GlobalizationPreferencesTest.java @@ -1258,8 +1258,8 @@ public class GlobalizationPreferencesTest extends TestFmwk { // Date/Time - full df = gp.getDateFormat(GlobalizationPreferences.DF_FULL, GlobalizationPreferences.DF_FULL); pattern = ((SimpleDateFormat)df).toPattern(); - if (!pattern.equals("EEEE, d MMMM y HH:mm:ss zzzz")) { - errln("FAIL: FULL date/time pattern is " + pattern + " Expected: EEEE, d MMMM y HH:mm:ss zzzz"); + if (!pattern.equals("EEEE, d MMMM y 'at' HH:mm:ss zzzz")) { + errln("FAIL: FULL date/time pattern is " + pattern + " Expected: EEEE, d MMMM y 'at' HH:mm:ss zzzz"); } // Invalid style diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java index ac41ca063b1..94f8f0caa41 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/calendar/IBMCalendarTest.java @@ -65,15 +65,15 @@ public class IBMCalendarTest extends CalendarTest { 2000, Calendar.MARCH, 20, 0, 0, 0, // Mon 00:00 2000, Calendar.MARCH, 20, 8, 0, 0, // Mon 08:00 }, - new Locale("ar", "OM"), new int[] { // Thursday:Friday + new Locale("ar", "OM"), new int[] { // Friday:Saturday 2000, Calendar.MARCH, 15, 23, 0, 0, // Wed 23:00 2000, Calendar.MARCH, 16, 0, -1, 0, // Wed 23:59:59.999 - 2000, Calendar.MARCH, 16, 0, 0, 1, // Thu 00:00 - 2000, Calendar.MARCH, 16, 15, 0, 1, // Thu 15:00 + 2000, Calendar.MARCH, 16, 0, 0, 0, // Thu 00:00 + 2000, Calendar.MARCH, 16, 15, 0, 0, // Thu 15:00 2000, Calendar.MARCH, 17, 23, 0, 1, // Fri 23:00 2000, Calendar.MARCH, 18, 0, -1, 1, // Fri 23:59:59.999 - 2000, Calendar.MARCH, 18, 0, 0, 0, // Sat 00:00 - 2000, Calendar.MARCH, 18, 8, 0, 0, // Sat 08:00 + 2000, Calendar.MARCH, 18, 0, 0, 1, // Sat 00:00 + 2000, Calendar.MARCH, 18, 8, 0, 1, // Sat 08:00 }, }; @@ -85,11 +85,11 @@ public class IBMCalendarTest extends CalendarTest { Calendar.SATURDAY, Calendar.WEEKEND, Calendar.SUNDAY, Calendar.WEEKEND, }, - new Locale("ar", "OM"), new int[] { // Thursday:Friday + new Locale("ar", "OM"), new int[] { // Friday:Saturday Calendar.WEDNESDAY,Calendar.WEEKDAY, - Calendar.SATURDAY, Calendar.WEEKDAY, - Calendar.THURSDAY, Calendar.WEEKEND, + Calendar.THURSDAY, Calendar.WEEKDAY, Calendar.FRIDAY, Calendar.WEEKEND, + Calendar.SATURDAY, Calendar.WEEKEND, }, new Locale("hi", "IN"), new int[] { // Sunday only Calendar.MONDAY, Calendar.WEEKDAY, diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/CompactDecimalFormatTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/CompactDecimalFormatTest.java index 1a2d7f12bba..5dc1017cca3 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/CompactDecimalFormatTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/CompactDecimalFormatTest.java @@ -1,6 +1,6 @@ /* ******************************************************************************* - * Copyright (C) 1996-2013, Google, International Business Machines Corporation and + * Copyright (C) 1996-2014, Google, International Business Machines Corporation and * others. All Rights Reserved. * ******************************************************************************* */ @@ -54,20 +54,20 @@ public class CompactDecimalFormatTest extends TestFmwk { }; Object[][] SerbianTestDataShort = { - {1234, "1200"}, - {12345, "12\u00a0хиљ"}, - {20789, "21\u00a0хиљ"}, - {123456, "120\u00a0хиљ"}, - {1234567, "1,2\u00a0мил"}, - {12345678, "12\u00a0мил"}, - {123456789, "120\u00a0мил"}, - {1234567890, "1,2\u00a0млрд"}, - {12345678901f, "12\u00a0млрд"}, - {123456789012f, "120\u00a0млрд"}, - {1234567890123f, "1,2\u00a0бил"}, - {12345678901234f, "12\u00a0бил"}, - {123456789012345f, "120\u00a0бил"}, - {1234567890123456f, "1200\u00a0бил"}, + {1234, "1,2\u00A0\u0445\u0438\u0459."}, + {12345, "12\u00a0хиљ."}, + {20789, "21\u00a0хиљ."}, + {123456, "120\u00a0хиљ."}, + {1234567, "1,2\u00a0мил."}, + {12345678, "12\u00a0мил."}, + {123456789, "120\u00a0мил."}, + {1234567890, "1,2\u00a0млрд."}, + {12345678901f, "12\u00a0млрд."}, + {123456789012f, "120\u00a0млрд."}, + {1234567890123f, "1,2\u00a0бил."}, + {12345678901234f, "12\u00a0бил."}, + {123456789012345f, "120\u00a0бил."}, + {1234567890123456f, "1200\u00a0бил."}, }; Object[][] SerbianTestDataLong = { @@ -128,7 +128,7 @@ public class CompactDecimalFormatTest extends TestFmwk { Object[][] SwahiliTestData = { {1234f, "elfu\u00a01.2"}, {12345f, "elfu\u00a012"}, - {123456f, "laki1.2"}, + {123456f, "elfu\u00A0120"}, {1234567f, "M1.2"}, {12345678f, "M12"}, {123456789f, "M120"}, @@ -166,7 +166,7 @@ public class CompactDecimalFormatTest extends TestFmwk { Object[][] SwahiliTestDataNegative = { {-1234f, "elfu\u00a0-1.2"}, {-12345f, "elfu\u00a0-12"}, - {-123456f, "laki-1.2"}, + {-123456f, "elfu\u00A0-120"}, {-1234567f, "M-1.2"}, {-12345678f, "M-12"}, {-123456789f, "M-120"}, diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateFormatTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateFormatTest.java index 8e53561d373..8a37b739108 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateFormatTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateFormatTest.java @@ -351,7 +351,7 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk { "", "", "", "", "", "1997", "ao\u00FBt", "13", "", "14", "34", "12", "", "mercredi", - "", "", "", "", "", "", "", "heure avanc\u00E9e du Pacifique", "", "", + "", "", "", "", "", "", "", "heure d\u2019\u00E9t\u00E9 du Pacifique", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", @@ -409,7 +409,7 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk { {"", "13", "mercredi", "", "", "", "", "", "14", "", "", "", "", "", "", - "34", "ao\u00FBt", "", "12", "heure avanc\u00E9e du Pacifique", + "34", "ao\u00FBt", "", "12", "heure d\u2019\u00E9t\u00E9 du Pacifique", "", "", "1997", ""}, {"PM", "13", "Wed", "2", "225", @@ -732,7 +732,7 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk { } } - private static final String GMT_BG = "\u0413\u0440\u0438\u0438\u043D\u0443\u0438\u0447"; + private static final String GMT_BG = "\u0413\u0440\u0438\u043D\u0443\u0438\u0447"; private static final String GMT_ZH = "GMT"; //private static final String GMT_ZH = "\u683C\u6797\u5C3C\u6CBB\u6807\u51C6\u65F6\u95F4"; //private static final String GMT_BG = "GMT"; @@ -1166,13 +1166,13 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk { { "hi", "Asia/Calcutta", "2004-01-15T00:00:00Z", "Z", "+0530", "+5:30" }, { "hi", "Asia/Calcutta", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+05:30", "+5:30" }, { "hi", "Asia/Calcutta", "2004-01-15T00:00:00Z", "z", "IST", "+5:30" }, - { "hi", "Asia/Calcutta", "2004-01-15T00:00:00Z", "zzzz", "\u092D\u093E\u0930\u0924\u0940\u092F \u0938\u092E\u092F", "+5:30" }, + { "hi", "Asia/Calcutta", "2004-01-15T00:00:00Z", "zzzz", "\u092D\u093E\u0930\u0924\u0940\u092F \u092E\u093E\u0928\u0915 \u0938\u092E\u092F", "+5:30" }, { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "Z", "+0530", "+5:30" }, { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+05:30"," +5:30" }, { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", "IST", "+05:30" }, - { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "\u092D\u093E\u0930\u0924\u0940\u092F \u0938\u092E\u092F", "+5:30" }, + { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "\u092D\u093E\u0930\u0924\u0940\u092F \u092E\u093E\u0928\u0915 \u0938\u092E\u092F", "+5:30" }, { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "IST", "Asia/Calcutta" }, - { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\u092D\u093E\u0930\u0924\u0940\u092F \u0938\u092E\u092F", "Asia/Calcutta" }, + { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\u092D\u093E\u0930\u0924\u0940\u092F \u092E\u093E\u0928\u0915 \u0938\u092E\u092F", "Asia/Calcutta" }, // ========== @@ -1271,13 +1271,13 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk { { "bg", "Asia/Calcutta", "2004-01-15T00:00:00Z", "Z", "+0530", "+5:30" }, { "bg", "Asia/Calcutta", "2004-01-15T00:00:00Z", "ZZZZ", GMT_BG+"+05:30", "+5:30" }, { "bg", "Asia/Calcutta", "2004-01-15T00:00:00Z", "z", GMT_BG+"+5:30", "+5:30" }, - { "bg", "Asia/Calcutta", "2004-01-15T00:00:00Z", "zzzz", "\u0418\u043d\u0434\u0438\u0439\u0441\u043a\u043e \u0432\u0440\u0435\u043c\u0435", "+5:30" }, + { "bg", "Asia/Calcutta", "2004-01-15T00:00:00Z", "zzzz", "\u0418\u043D\u0434\u0438\u0439\u0441\u043A\u043E \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E \u0432\u0440\u0435\u043C\u0435", "+5:30" }, { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "Z", "+0530", "+5:30" }, { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", GMT_BG+"+05:30", "+5:30" }, { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", GMT_BG+"+5:30", "+05:30" }, - { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "\u0418\u043d\u0434\u0438\u0439\u0441\u043a\u043e \u0432\u0440\u0435\u043c\u0435", "+5:30" }, + { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "\u0418\u043D\u0434\u0438\u0439\u0441\u043A\u043E \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E \u0432\u0440\u0435\u043C\u0435", "+5:30" }, { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "\u0418\u043D\u0434\u0438\u044F", "Asia/Calcutta" }, - { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\u0418\u043d\u0434\u0438\u0439\u0441\u043a\u043e \u0432\u0440\u0435\u043c\u0435", "Asia/Calcutta" }, + { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\u0418\u043D\u0434\u0438\u0439\u0441\u043A\u043E \u0441\u0442\u0430\u043D\u0434\u0430\u0440\u0442\u043D\u043E \u0432\u0440\u0435\u043C\u0435", "Asia/Calcutta" }, // ========== @@ -1379,13 +1379,13 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk { { "ja", "Asia/Calcutta", "2004-01-15T00:00:00Z", "Z", "+0530", "+5:30" }, { "ja", "Asia/Calcutta", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+05:30", "+5:30" }, { "ja", "Asia/Calcutta", "2004-01-15T00:00:00Z", "z", "GMT+5:30", "+5:30" }, - { "ja", "Asia/Calcutta", "2004-01-15T00:00:00Z", "zzzz", "\u30A4\u30F3\u30C9\u6642\u9593", "+5:30" }, + { "ja", "Asia/Calcutta", "2004-01-15T00:00:00Z", "zzzz", "\u30A4\u30F3\u30C9\u6A19\u6E96\u6642", "+5:30" }, { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "Z", "+0530", "+5:30" }, { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+05:30", "+5:30" }, { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", "GMT+5:30", "+05:30" }, - { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "\u30A4\u30F3\u30C9\u6642\u9593", "+5:30" }, + { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "\u30A4\u30F3\u30C9\u6A19\u6E96\u6642", "+5:30" }, { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "\u30A4\u30F3\u30C9\u6642\u9593", "Asia/Calcutta" }, - { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\u30A4\u30F3\u30C9\u6642\u9593", "Asia/Calcutta" }, + { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\u30A4\u30F3\u30C9\u6A19\u6E96\u6642", "Asia/Calcutta" }, // ========== // - We want a locale here that doesn't have anything in the way of translations @@ -1977,7 +1977,7 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk { TimeZone tz = TimeZone.getTimeZone("PST"); dfFrench.setTimeZone(tz); dfUS.setTimeZone(tz); - String expectedFRENCH_JDK12 = "lundi 15 septembre 1997 00:00:00 heure avanc\u00E9e du Pacifique"; + String expectedFRENCH_JDK12 = "lundi 15 septembre 1997 00:00:00 heure d\u2019\u00E9t\u00E9 du Pacifique"; //String expectedFRENCH = "lundi 15 septembre 1997 00 h 00 PDT"; String expectedUS = "Monday, September 15, 1997 at 12:00:00 AM Pacific Daylight Time"; logln("Date set to : " + testDate); @@ -2799,8 +2799,8 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk { String SV_DATA[] = { "yyyy MM dd HH:mm:ss", - "EEEEEE d MMM y", "fp", "2013 01 13 0:00:00", "s\u00F6 13 jan 2013", "2013 01 13 0:00:00", - "EEEEEE d MMM y", "fp", "2013 01 16 0:00:00", "on 16 jan 2013", "2013 01 16 0:00:00", + "EEEEEE d MMM y", "fp", "2013 01 13 0:00:00", "s\u00F6 13 jan. 2013", "2013 01 13 0:00:00", + "EEEEEE d MMM y", "fp", "2013 01 16 0:00:00", "on 16 jan. 2013", "2013 01 16 0:00:00", "EEEEEE d", "fp", "1970 01 17 0:00:00", "l\u00F6 17", "1970 01 17 0:00:00", "cccccc d", "fp", "1970 01 17 0:00:00", "L\u00F6 17", "1970 01 17 0:00:00", "cccccc", "fp", "1970 01 03 0:00:00", "L\u00F6", "1970 01 03 0:00:00", @@ -2864,7 +2864,7 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk { String CS_DATA[] = { "yyyy MM dd HH:mm:ss", - "yyyy LLLLL dd H:mm:ss", "2004 04 10 16:36:31", "2004 d 10 16:36:31", + "yyyy LLLLL dd H:mm:ss", "2004 04 10 16:36:31", "2004 4 10 16:36:31", "yyyy MMMMM dd H:mm:ss", "2004 04 10 16:36:31", "2004 4 10 16:36:31", "MMMMM", "1970 01 01 0:00:00", "1", @@ -2880,18 +2880,18 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk { "MMMMM", "1970 11 01 0:00:00", "11", "MMMMM", "1970 12 01 0:00:00", "12", - "LLLLL", "1970 01 01 0:00:00", "l", - "LLLLL", "1970 02 01 0:00:00", "\u00FA", - "LLLLL", "1970 03 01 0:00:00", "b", - "LLLLL", "1970 04 01 0:00:00", "d", - "LLLLL", "1970 05 01 0:00:00", "k", - "LLLLL", "1970 06 01 0:00:00", "\u010D", - "LLLLL", "1970 07 01 0:00:00", "\u010D", - "LLLLL", "1970 08 01 0:00:00", "s", - "LLLLL", "1970 09 01 0:00:00", "z", - "LLLLL", "1970 10 01 0:00:00", "\u0159", - "LLLLL", "1970 11 01 0:00:00", "l", - "LLLLL", "1970 12 01 0:00:00", "p", + "LLLLL", "1970 01 01 0:00:00", "1", + "LLLLL", "1970 02 01 0:00:00", "2", + "LLLLL", "1970 03 01 0:00:00", "3", + "LLLLL", "1970 04 01 0:00:00", "4", + "LLLLL", "1970 05 01 0:00:00", "5", + "LLLLL", "1970 06 01 0:00:00", "6", + "LLLLL", "1970 07 01 0:00:00", "7", + "LLLLL", "1970 08 01 0:00:00", "8", + "LLLLL", "1970 09 01 0:00:00", "9", + "LLLLL", "1970 10 01 0:00:00", "10", + "LLLLL", "1970 11 01 0:00:00", "11", + "LLLLL", "1970 12 01 0:00:00", "12", "EEEEE", "1970 01 04 0:00:00", "N", "EEEEE", "1970 01 05 0:00:00", "P", @@ -4085,10 +4085,12 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk { new MonthPatternItem( "en@calendar=dangi", DateFormat.LONG, "Month3bis 2, ren-chen", "Month4 2, ren-chen", "Month5 1, ren-chen" ), new MonthPatternItem( "en@calendar=dangi", DateFormat.SHORT, "3bis/2/29", "4/2/29", "5/1/29" ), new MonthPatternItem( "en@calendar=dangi", -2, "78x29-3bis-2", "78x29-4-2", "78x29-5-1" ), - new MonthPatternItem( "ko@calendar=dangi", DateFormat.LONG, "\uC784\uC9C4\uB144 3bis\uC6D4 2\uC77C", + new MonthPatternItem( "ko@calendar=dangi", DateFormat.LONG, "\uC784\uC9C4\uB144 \uC7243\uC6D4\uC6D4 2\uC77C", // problem, see cldrbug 7868: "\uC784\uC9C4\uB144 4\uC6D4 2\uC77C", "\uC784\uC9C4\uB144 5\uC6D4 1\uC77C" ), - new MonthPatternItem( "ko@calendar=dangi", DateFormat.SHORT, "29. 3bis. 2.", "29. 4. 2.", "29. 5. 1." ), + new MonthPatternItem( "ko@calendar=dangi", DateFormat.SHORT, "29. \uC7243\uC6D4. 2.", // possible problem, see cldrbug 7868: + "29. 4. 2.", + "29. 5. 1." ), }; // style: -1 -2 -3 -4 final String[] customPatterns = { "y-Ml-d", "G'x'y-Ml-d", "U-M-d", "U MMM d" }; // previously G and l for chinese cal only handled by ChineseDateFormat @@ -4176,6 +4178,9 @@ public class DateFormatTest extends com.ibm.icu.dev.test.TestFmwk { new TestNonGregoItem( "he@calendar=hebrew", DateFormat.LONG, cafti_he_hebrew_long ), }; for (TestNonGregoItem item: items) { + if (item.locale.equals("he@calendar=hebrew") && logKnownIssue("11219", "Skip tests that depend on hebr numbers in the thousands")) { + continue; + } ULocale locale = new ULocale(item.locale); DateFormat dfmt = DateFormat.getDateInstance(item.style, locale); Calendar cal = dfmt.getCalendar(); diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateIntervalFormatTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateIntervalFormatTest.java index 874d2e4c018..40f5cd23b52 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateIntervalFormatTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateIntervalFormatTest.java @@ -437,7 +437,7 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk { "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "dM", "11/10 \\u2013 11/20", - "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "2007/11", + "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "My", "2007\u5E7411\u6708", "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EdM", "11/10\\u5468\\u516d\\u81f311/20\\u5468\\u4e8c", "zh", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "d", "10\\u201320\\u65e5", @@ -512,9 +512,9 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk { "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "MMM", "Okt. 2007 - Okt. 2008", - "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "10.10.2007 10:10 vorm. - 10.10.2008 10:10 vorm.", + "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "hm", "10.10.2007, 10:10 vorm. - 10.10.2008, 10:10 vorm.", - "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "jm", "10.10.2007 10:10 - 10.10.2008 10:10", + "de", "2007 10 10 10:10:10", "2008 10 10 10:10:10", "jm", "10.10.2007, 10:10 - 10.10.2008, 10:10", "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "EEEEdMMMy", "Mittwoch, 10. Okt. - Samstag, 10. Nov. 2007", @@ -541,11 +541,11 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk { "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "MMM", "Okt.-Nov.", - "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmv", "10.10.2007 10:10 vorm. Los Angeles Zeit - 10.11.2007 10:10 vorm. Los Angeles Zeit", + "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hmv", "10.10.2007, 10:10 vorm. Los Angeles Zeit - 10.11.2007, 10:10 vorm. Los Angeles Zeit", - "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "jmv", "10.10.2007 10:10 Los Angeles Zeit - 10.11.2007 10:10 Los Angeles Zeit", + "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "jmv", "10.10.2007, 10:10 Los Angeles Zeit - 10.11.2007, 10:10 Los Angeles Zeit", - "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hms", "10.10.2007 10:10:10 vorm. - 10.11.2007 10:10:10 vorm.", + "de", "2007 10 10 10:10:10", "2007 11 10 10:10:10", "hms", "10.10.2007, 10:10:10 vorm. - 10.11.2007, 10:10:10 vorm.", "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "EEEEdMMMy", "Samstag, 10. - Dienstag, 20. Nov. 2007", @@ -573,9 +573,9 @@ public class DateIntervalFormatTest extends com.ibm.icu.dev.test.TestFmwk { "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "M", "11", - "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmv", "10.11.2007 10:10 vorm. Los Angeles Zeit - 20.11.2007 10:10 vorm. Los Angeles Zeit", + "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "hmv", "10.11.2007, 10:10 vorm. Los Angeles Zeit - 20.11.2007, 10:10 vorm. Los Angeles Zeit", - "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "jmv", "10.11.2007 10:10 Los Angeles Zeit - 20.11.2007 10:10 Los Angeles Zeit", + "de", "2007 11 10 10:10:10", "2007 11 20 10:10:10", "jmv", "10.11.2007, 10:10 Los Angeles Zeit - 20.11.2007, 10:10 Los Angeles Zeit", "de", "2007 01 10 10:00:10", "2007 01 10 14:10:10", "EEEEdMMMy", "Mittwoch, 10. Jan. 2007", diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java index a93194932c2..f7a72bf4ef3 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java @@ -61,7 +61,7 @@ public class DateTimeGeneratorTest extends TestFmwk { DateTimePatternGenerator gen = DateTimePatternGenerator.getInstance(locale); SimpleDateFormat format = new SimpleDateFormat(gen.getBestPattern("MMMddHmm"), locale); format.setTimeZone(zone); - assertEquals("simple format: MMMddHmm", "14. Okt. 08:58", format.format(sampleDate)); // (fixed expected result per ticket 6872<-7180) + assertEquals("simple format: MMMddHmm", "14. Okt., 08:58", format.format(sampleDate)); // (a generator can be built from scratch, but that is not a typical use case) // modify the generator by adding patterns @@ -69,18 +69,18 @@ public class DateTimeGeneratorTest extends TestFmwk { gen.addPattern("d'. von' MMMM", true, returnInfo); // the returnInfo is mostly useful for debugging problem cases format.applyPattern(gen.getBestPattern("MMMMdHmm")); - assertEquals("modified format: MMMdHmm", "14. von Oktober 08:58", format.format(sampleDate)); // (fixed expected result per ticket 6872<-7180) + assertEquals("modified format: MMMdHmm", "14. von Oktober, 08:58", format.format(sampleDate)); // get a pattern and modify it format = (SimpleDateFormat)DateFormat.getDateTimeInstance(DateFormat.FULL, DateFormat.FULL, locale); format.setTimeZone(zone); String pattern = format.toPattern(); - assertEquals("full-date", "Donnerstag, 14. Oktober 1999 08:58:59 Mitteleurop\u00E4ische Sommerzeit", format.format(sampleDate)); + assertEquals("full-date", "Donnerstag, 14. Oktober 1999 um 08:58:59 Mitteleurop\u00E4ische Sommerzeit", format.format(sampleDate)); // modify it to change the zone. String newPattern = gen.replaceFieldTypes(pattern, "vvvv"); format.applyPattern(newPattern); - assertEquals("full-date: modified zone", "Donnerstag, 14. Oktober 1999 08:58:59 Mitteleurop\u00E4ische Zeit", format.format(sampleDate)); + assertEquals("full-date: modified zone", "Donnerstag, 14. Oktober 1999 um 08:58:59 Mitteleurop\u00E4ische Zeit", format.format(sampleDate)); // add test of basic cases @@ -360,7 +360,7 @@ public class DateTimeGeneratorTest extends TestFmwk { new String[] {"jjmm", "23:58"}, new String[] {"mmss", "58:59"}, new String[] {"yyyyMMMM", "enero de 1999"}, - new String[] {"MMMEd", "mi\u00E9. 13 de ene."}, + new String[] {"MMMEd", "mi\u00E9., 13 de ene."}, new String[] {"Ed", "mi\u00E9. 13"}, new String[] {"jmmssSSS", "23:58:59,123"}, new String[] {"JJmm", "23:58"}, @@ -392,7 +392,7 @@ public class DateTimeGeneratorTest extends TestFmwk { new String[] {"Md", "1/13"}, new String[] {"MMMd", "1\u670813\u65E5"}, new String[] {"MMMMd", "1\u670813\u65E5"}, - new String[] {"yQQQ", "\u5E73\u6210 11 Q1"}, + new String[] {"yQQQ", "\u5E73\u621011/Q1"}, new String[] {"hhmm", "\u5348\u5F8C11:58"}, new String[] {"HHmm", "23:58"}, new String[] {"jjmm", "23:58"}, @@ -404,7 +404,7 @@ public class DateTimeGeneratorTest extends TestFmwk { new String[] {"JJmm", "23:58"}, new ULocale("zh_Hans_CN"), - new String[] {"yM", "1999/1"}, + new String[] {"yM", "1999\u5E741\u6708"}, new String[] {"yMMM", "1999\u5E741\u6708"}, // (fixed expected result per ticket 6872<-6626) new String[] {"yMd", "1999/1/13"}, new String[] {"yMMMd", "1999\u5E741\u670813\u65E5"}, // (fixed expected result per ticket 6872<-6626) @@ -443,7 +443,7 @@ public class DateTimeGeneratorTest extends TestFmwk { new ULocale("ru"), new String[] {"yM", "01.1999"}, - new String[] {"yMMM", "\u042F\u043D\u0432. 1999"}, + new String[] {"yMMM", "\u044F\u043D\u0432. 1999"}, new String[] {"yMd", "13.01.1999"}, new String[] {"yMMMd", "13 \u044F\u043D\u0432. 1999 \u0433."}, new String[] {"Md", "13.01"}, @@ -454,7 +454,7 @@ public class DateTimeGeneratorTest extends TestFmwk { new String[] {"HHmm", "23:58"}, new String[] {"jjmm", "23:58"}, new String[] {"mmss", "58:59"}, - new String[] {"yyyyMMMM", "\u042F\u043D\u0432\u0430\u0440\u044C 1999"}, + new String[] {"yyyyMMMM", "\u044F\u043D\u0432\u0430\u0440\u044C 1999"}, new String[] {"MMMEd", "\u0421\u0440, 13 \u044F\u043D\u0432."}, new String[] {"Ed", "\u0421\u0440, 13"}, new String[] {"jmmssSSS", "23:58:59,123"}, diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java index 229a08828e3..d7ed56562e3 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/MeasureUnitTest.java @@ -400,6 +400,7 @@ public class MeasureUnitTest extends TestFmwk { FormatWidth[] styles = new FormatWidth[] {FormatWidth.WIDE, FormatWidth.SHORT}; int[] numbers = new int[] {1, 7}; String[] expected = { + // "el_GR" 1 wide "1 δευτερόλεπτο", "1 λεπτό", "1 ώρα", @@ -407,13 +408,15 @@ public class MeasureUnitTest extends TestFmwk { "1 εβδομάδα", "1 μήνας", "1 έτος", + // "el_GR" 1 short "1 δευτ.", "1 λεπ.", "1 ώρα", "1 ημέρα", "1 εβδ.", "1 μήν.", - "1 έτος", + "1 έτ.", // year (one) + // "el_GR" 7 wide "7 δευτερόλεπτα", "7 λεπτά", "7 ώρες", @@ -421,13 +424,15 @@ public class MeasureUnitTest extends TestFmwk { "7 εβδομάδες", "7 μήνες", "7 έτη", + // "el_GR" 7 short "7 δευτ.", "7 λεπ.", - "7 ώρες", + "7 ώρ.", // hour (other) "7 ημέρες", "7 εβδ.", "7 μήν.", - "7 έτη", + "7 έτ.", // year (other) + // "el" 1 wide "1 δευτερόλεπτο", "1 λεπτό", "1 ώρα", @@ -435,13 +440,15 @@ public class MeasureUnitTest extends TestFmwk { "1 εβδομάδα", "1 μήνας", "1 έτος", + // "el" 1 short "1 δευτ.", "1 λεπ.", "1 ώρα", "1 ημέρα", "1 εβδ.", "1 μήν.", - "1 έτος", + "1 έτ.", // year (one) + // "el" 7 wide "7 δευτερόλεπτα", "7 λεπτά", "7 ώρες", @@ -449,13 +456,14 @@ public class MeasureUnitTest extends TestFmwk { "7 εβδομάδες", "7 μήνες", "7 έτη", + // "el" 7 short "7 δευτ.", "7 λεπ.", - "7 ώρες", + "7 ώρ.", // hour (other) "7 ημέρες", "7 εβδ.", "7 μήν.", - "7 έτη"}; + "7 έτ."}; // year (other int counter = 0; String formatted; for ( int locIndex = 0; locIndex < locales.length; ++locIndex ) { @@ -516,7 +524,7 @@ public class MeasureUnitTest extends TestFmwk { {ULocale.ENGLISH, FormatWidth.SHORT, "2 mi, 1 ft, 2.3 in"}, {ULocale.ENGLISH, FormatWidth.NARROW, "2mi 1\u2032 2.3\u2033"}, {russia, FormatWidth.WIDE, "2 \u043C\u0438\u043B\u0438, 1 \u0444\u0443\u0442 \u0438 2,3 \u0434\u044E\u0439\u043C\u0430"}, - {russia, FormatWidth.SHORT, "2 \u043C\u0438\u043B\u0438, 1 \u0444\u0443\u0442, 2,3 \u0434\u044E\u0439\u043C\u0430"}, + {russia, FormatWidth.SHORT, "2 \u043C\u0438\u043B\u0438, 1 \u0444\u0443\u0442, 2,3 \u0434\u044E\u0439\u043C."}, {russia, FormatWidth.NARROW, "2 \u043C\u0438\u043B\u044C 1 \u0444\u0443\u0442 2,3 \u0434\u044E\u0439\u043C\u0430"}, }; for (Object[] row : data) { diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java index 8db671984b9..5d5eb728ac8 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java @@ -561,7 +561,7 @@ public class NumberFormatTest extends com.ibm.icu.dev.test.TestFmwk { String[] DATA = { "fr", "CA", "", "1,50\u00a0$", "de", "DE", "", "1,50\u00a0\u20AC", - "de", "DE", "PREEURO", "1,50\u00a0DEM", + "de", "DE", "PREEURO", "1,50\u00a0DM", "fr", "FR", "", "1,50\u00a0\u20AC", "fr", "FR", "PREEURO", "1,50\u00a0F", }; @@ -848,7 +848,7 @@ public class NumberFormatTest extends com.ibm.icu.dev.test.TestFmwk { expectCurrency(fmt, null, 1234.56, "1 234,56 \u20AC"); expectCurrency(fmt, Currency.getInstance(Locale.JAPAN), - 1234.56, "1 235 \u00A5JP"); // Yen + 1234.56, "1 235 JPY"); // Yen expectCurrency(fmt, Currency.getInstance(new Locale("fr", "CH", "")), 1234.56, "1 234,56 CHF"); // no more rounding here, see cldrbug 5548 @@ -1544,6 +1544,9 @@ public class NumberFormatTest extends com.ibm.icu.dev.test.TestFmwk { for (TestNumberingSystemItem item : DATA) { + if (item.localeName.equals("en_US@numbers=hebr") && logKnownIssue("11219", "Skip tests that depend on hebr numbers in the thousands")) { + continue; + } ULocale loc = new ULocale(item.localeName); NumberFormat fmt = NumberFormat.getInstance(loc); if (item.isRBNF) { @@ -2338,7 +2341,7 @@ public class NumberFormatTest extends com.ibm.icu.dev.test.TestFmwk { CurrencyAmount cAmt = new CurrencyAmount(1150.50, curr); logln("CurrencyAmount object's hashCode is: " + cAmt.hashCode()); //cover hashCode String str = format.format(cAmt); - String expected = "1,150$50\u00a0Esc."; + String expected = "1,150$50\u00a0\u200b"; if(!expected.equals(str)){ errln("Did not get the expected output Expected: "+expected+" Got: "+ str); } @@ -3612,11 +3615,14 @@ public class NumberFormatTest extends com.ibm.icu.dev.test.TestFmwk { public void TestCurrencyUsage() { // the 1st one is checking setter/getter, while the 2nd one checks for getInstance // compare the Currency and Currency Cash Digits + // Note that as of CLDR 26: + // * TWD switches from 0 decimals to 2; PKR still has 0, so change test to that + // * CAD and all other currencies that rounded to .05 no longer do for (int i = 0; i < 2; i++) { - String original_expected = "NT$123.57"; + String original_expected = "PKR124"; DecimalFormat custom = null; if (i == 0) { - custom = (DecimalFormat) DecimalFormat.getInstance(new ULocale("en_US@currency=TWD"), + custom = (DecimalFormat) DecimalFormat.getInstance(new ULocale("en_US@currency=PKR"), DecimalFormat.CURRENCYSTYLE); String original = custom.format(123.567); @@ -3628,7 +3634,7 @@ public class NumberFormatTest extends com.ibm.icu.dev.test.TestFmwk { custom.setCurrencyUsage(Currency.CurrencyUsage.CASH); assertEquals("Test Currency Context Purpose", custom.getCurrencyUsage(), Currency.CurrencyUsage.CASH); } else { - custom = (DecimalFormat) DecimalFormat.getInstance(new ULocale("en_US@currency=TWD"), + custom = (DecimalFormat) DecimalFormat.getInstance(new ULocale("en_US@currency=PKR"), DecimalFormat.CASHCURRENCYSTYLE); // test the getter @@ -3636,7 +3642,7 @@ public class NumberFormatTest extends com.ibm.icu.dev.test.TestFmwk { } String cash_currency = custom.format(123.567); - String cash_currency_expected = "NT$124"; + String cash_currency_expected = "PKR124"; assertEquals("Test Currency Context", cash_currency_expected, cash_currency); } @@ -3659,7 +3665,7 @@ public class NumberFormatTest extends com.ibm.icu.dev.test.TestFmwk { } String cash_rounding_currency = fmt.format(123.567); - String cash__rounding_currency_expected = "CA$123.55"; + String cash__rounding_currency_expected = "CA$123.57"; assertEquals("Test Currency Context", cash__rounding_currency_expected, cash_rounding_currency); } @@ -3676,10 +3682,10 @@ public class NumberFormatTest extends com.ibm.icu.dev.test.TestFmwk { NumberFormat.CASHCURRENCYSTYLE); } - fmt2.setCurrency(Currency.getInstance("TWD")); - String TWD_changed = fmt2.format(123.567); - String TWD_changed_expected = "NT$124"; - assertEquals("Test Currency Context", TWD_changed_expected, TWD_changed); + fmt2.setCurrency(Currency.getInstance("PKR")); + String PKR_changed = fmt2.format(123.567); + String PKR_changed_expected = "PKR124"; + assertEquals("Test Currency Context", PKR_changed_expected, PKR_changed); } } diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberRegression.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberRegression.java index fa2e5b1a21e..a8952d60665 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberRegression.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberRegression.java @@ -1,6 +1,6 @@ /***************************************************************************************** * - * Copyright (C) 1996-2013, International Business Machines + * Copyright (C) 1996-2014, International Business Machines * Corporation and others. All Rights Reserved. **/ @@ -1548,6 +1548,9 @@ public class NumberRegression extends com.ibm.icu.dev.test.TestFmwk { // trip properly. Test stream in/out integrity too. Locale[] avail = NumberFormat.getAvailableLocales(); for (int i=0; i 1); assertEquals( "With tender", - Arrays.asList(new String[] {"CHF"}), + Arrays.asList(new String[] {"CHF", "CHE", "CHW"}), metainfo.currencies(filter.withTender())); } @@ -534,9 +534,9 @@ public class CurrencyTest extends TestFmwk { { "eo_AO", "1969-12-31" }, { "eo_DE@currency=DEM", "2000-12-23", "EUR", "DEM" }, { "eo-DE-u-cu-dem", "2000-12-23", "EUR", "DEM" }, - { "en_US", null, "USD" }, - { "en_US_PREEURO", null, "USD" }, - { "en_US_Q", null, "USD" }, + { "en_US", null, "USD", "USN" }, + { "en_US_PREEURO", null, "USD", "USN" }, + { "en_US_Q", null, "USD", "USN" }, }; DateFormat fmt = new SimpleDateFormat("yyyy-MM-dd", Locale.US); @@ -623,16 +623,16 @@ public class CurrencyTest extends TestFmwk { final String[][] PREFERRED = { {"root", }, {"und", }, - {"und_ZZ", }, - {"en_US", "USD"}, + {"und_ZZ", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XDR", "XPD", "XPT", "XSU", "XTS", "XUA", "XXX"}, + {"en_US", "USD", "USN"}, {"en_029", }, {"en_TH", "THB"}, {"de", "EUR"}, {"de_DE", "EUR"}, - {"de_ZZ", }, + {"de_ZZ", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XDR", "XPD", "XPT", "XSU", "XTS", "XUA", "XXX"}, {"ar", "EGP"}, {"ar_PS", "ILS", "JOD"}, - {"en@currency=CAD", "USD"}, + {"en@currency=CAD", "USD", "USN"}, {"fr@currency=ZZZ", "EUR"}, {"de_DE@currency=DEM", "EUR"}, }; diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUResourceBundleTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUResourceBundleTest.java index 0168f3f0585..2ef2aee9002 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUResourceBundleTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ICUResourceBundleTest.java @@ -686,9 +686,8 @@ public final class ICUResourceBundleTest extends TestFmwk { errln("Could not get English localized language for " + locales[i]); } if(!hasLocalizedCountryFor(locales[i], locales[i]) && - (locales[i].getLanguage().compareTo("ti") != 0) && // TODO: restore test for ti_* when cldrbug 3058 is fixed - (locales[i].getBaseName().compareTo("nl_CW") != 0) && // TODO: restore test for nl_CW when cldrbug 4306 is fixed - (locales[i].getBaseName().compareTo("nl_SX") != 0) ){ // TODO: restore test for nl_SX when cldrbug 4306 is fixed + !(locales[i].getLanguage().equals("ti") || // TODO: restore test for ti_* when cldrbug 3058 is fixed + ((locales[i].getBaseName().equals("sah_RU") || locales[i].getBaseName().equals("smn_FI")) && logKnownIssue("cldrbug:7872", "No localized region name for sah_RU, smn_FI")))) { errln("Could not get native localized country for " + locales[i]); hasLocalizedCountryFor(locales[i], locales[i]); } @@ -867,7 +866,7 @@ public final class ICUResourceBundleTest extends TestFmwk { public void TestLoadingStatus(){ ICUResourceBundle bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "yi_IL"); - assertDefaultLoadingStatus("base/yi_IL", bundle.getLoadingStatus()); + assertFallbackLoadingStatus("base/yi_IL", bundle.getLoadingStatus()); bundle = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, "eo_DE"); assertFallbackLoadingStatus("base/eo_DE", bundle.getLoadingStatus()); diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java index 0df7c7f77ca..ecc2f9a9b72 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/ULocaleTest.java @@ -2989,8 +2989,8 @@ public class ULocaleTest extends TestFmwk { "it_SM" }, { "und_SN", - "fr_Latn_SN", - "fr_SN" + "wo_Latn_SN", + "wo" }, { "und_SO", "so_Latn_SO", @@ -3101,8 +3101,8 @@ public class ULocaleTest extends TestFmwk { "uz" }, { "und_VA", - "la_Latn_VA", - "la" + "it_Latn_VA", + "it_VA" }, { "und_VE", "es_Latn_VE", -- 2.40.0