Skip to content

Commit 08286bb

Browse files
authored
CLDR-18370 Use onlyAvailableFormats patterns for skeletons in datetime test data (#5057)
1 parent e50d8df commit 08286bb

File tree

3 files changed

+34
-35
lines changed

3 files changed

+34
-35
lines changed

common/testData/datetime/datetime.json

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,7 +1839,7 @@
18391839
"calendar": "buddhist",
18401840
"locale": "th-TH",
18411841
"input": "2000-01-01T00:00Z[Etc/GMT]",
1842-
"expected": "1/1 0 นาฬิกา 00 นาที 00 วินาที GMT"
1842+
"expected": "1/1 00:00:00 GMT"
18431843
},
18441844
{
18451845
"semanticSkeleton": "MDTZ",
@@ -1849,7 +1849,7 @@
18491849
"calendar": "buddhist",
18501850
"locale": "th-TH",
18511851
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
1852-
"expected": "1/1 0 นาฬิกา 00 นาที 00 วินาที GMT+10:30"
1852+
"expected": "1/1 00:00:00 GMT+10:30"
18531853
},
18541854
{
18551855
"semanticSkeleton": "MDTZ",
@@ -1859,7 +1859,7 @@
18591859
"calendar": "buddhist",
18601860
"locale": "th-TH",
18611861
"input": "2000-01-01T00:00Z[Etc/GMT]",
1862-
"expected": "1 มกราคม 0 นาฬิกา 00 นาที 00 วินาที GMT"
1862+
"expected": "1 มกราคม 00:00:00 GMT"
18631863
},
18641864
{
18651865
"semanticSkeleton": "MDTZ",
@@ -1869,7 +1869,7 @@
18691869
"calendar": "buddhist",
18701870
"locale": "th-TH",
18711871
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
1872-
"expected": "1 มกราคม 0 นาฬิกา 00 นาที 00 วินาที GMT+10:30"
1872+
"expected": "1 มกราคม 00:00:00 GMT+10:30"
18731873
},
18741874
{
18751875
"semanticSkeleton": "MDTZ",
@@ -1879,7 +1879,7 @@
18791879
"calendar": "buddhist",
18801880
"locale": "th-TH",
18811881
"input": "2000-01-01T00:00Z[Etc/GMT]",
1882-
"expected": "1/1 0 นาฬิกา 00 นาที 00 วินาที GMT"
1882+
"expected": "1/1 00:00:00 GMT"
18831883
},
18841884
{
18851885
"semanticSkeleton": "MDTZ",
@@ -1889,7 +1889,7 @@
18891889
"calendar": "buddhist",
18901890
"locale": "th-TH",
18911891
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
1892-
"expected": "1/1 0 นาฬิกา 00 นาที 00 วินาที เวลาแอดิเลด"
1892+
"expected": "1/1 00:00:00 เวลาแอดิเลด"
18931893
},
18941894
{
18951895
"semanticSkeleton": "MDTZ",
@@ -1899,7 +1899,7 @@
18991899
"calendar": "buddhist",
19001900
"locale": "th-TH",
19011901
"input": "2000-01-01T00:00Z[Etc/GMT]",
1902-
"expected": "1 มกราคม 0 นาฬิกา 00 นาที 00 วินาที GMT"
1902+
"expected": "1 มกราคม 00:00:00 GMT"
19031903
},
19041904
{
19051905
"semanticSkeleton": "MDTZ",
@@ -1909,7 +1909,7 @@
19091909
"calendar": "buddhist",
19101910
"locale": "th-TH",
19111911
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
1912-
"expected": "1 มกราคม 0 นาฬิกา 00 นาที 00 วินาที เวลาแอดิเลด"
1912+
"expected": "1 มกราคม 00:00:00 เวลาแอดิเลด"
19131913
},
19141914
{
19151915
"semanticSkeleton": "MDTZ",
@@ -1919,7 +1919,7 @@
19191919
"calendar": "buddhist",
19201920
"locale": "th-TH",
19211921
"input": "2000-01-01T00:00Z[Etc/GMT]",
1922-
"expected": "1/1 0 นาฬิกา 00 นาที 00 วินาที GMT"
1922+
"expected": "1/1 00:00:00 GMT"
19231923
},
19241924
{
19251925
"semanticSkeleton": "MDTZ",
@@ -1929,7 +1929,7 @@
19291929
"calendar": "buddhist",
19301930
"locale": "th-TH",
19311931
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
1932-
"expected": "1/1 0 นาฬิกา 00 นาที 00 วินาที เวลาแอดิเลด"
1932+
"expected": "1/1 00:00:00 เวลาแอดิเลด"
19331933
},
19341934
{
19351935
"semanticSkeleton": "MDTZ",
@@ -1939,7 +1939,7 @@
19391939
"calendar": "buddhist",
19401940
"locale": "th-TH",
19411941
"input": "2000-01-01T00:00Z[Etc/GMT]",
1942-
"expected": "1 มกราคม 0 นาฬิกา 00 นาที 00 วินาที GMT"
1942+
"expected": "1 มกราคม 00:00:00 GMT"
19431943
},
19441944
{
19451945
"semanticSkeleton": "MDTZ",
@@ -1949,7 +1949,7 @@
19491949
"calendar": "buddhist",
19501950
"locale": "th-TH",
19511951
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
1952-
"expected": "1 มกราคม 0 นาฬิกา 00 นาที 00 วินาที เวลาแอดิเลด"
1952+
"expected": "1 มกราคม 00:00:00 เวลาแอดิเลด"
19531953
},
19541954
{
19551955
"semanticSkeleton": "MDTZ",
@@ -1959,7 +1959,7 @@
19591959
"calendar": "buddhist",
19601960
"locale": "th-TH",
19611961
"input": "2000-01-01T00:00Z[Etc/GMT]",
1962-
"expected": "1/1 0 นาฬิกา 00 นาที 00 วินาที GMT"
1962+
"expected": "1/1 00:00:00 GMT"
19631963
},
19641964
{
19651965
"semanticSkeleton": "MDTZ",
@@ -1969,7 +1969,7 @@
19691969
"calendar": "buddhist",
19701970
"locale": "th-TH",
19711971
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
1972-
"expected": "1/1 0 นาฬิกา 00 นาที 00 วินาที GMT+10:30"
1972+
"expected": "1/1 00:00:00 GMT+10:30"
19731973
},
19741974
{
19751975
"semanticSkeleton": "MDTZ",
@@ -1979,7 +1979,7 @@
19791979
"calendar": "buddhist",
19801980
"locale": "th-TH",
19811981
"input": "2000-01-01T00:00Z[Etc/GMT]",
1982-
"expected": "1 มกราคม 0 นาฬิกา 00 นาที 00 วินาที GMT"
1982+
"expected": "1 มกราคม 00:00:00 GMT"
19831983
},
19841984
{
19851985
"semanticSkeleton": "MDTZ",
@@ -1989,7 +1989,7 @@
19891989
"calendar": "buddhist",
19901990
"locale": "th-TH",
19911991
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
1992-
"expected": "1 มกราคม 0 นาฬิกา 00 นาที 00 วินาที GMT+10:30"
1992+
"expected": "1 มกราคม 00:00:00 GMT+10:30"
19931993
},
19941994
{
19951995
"semanticSkeleton": "M",
@@ -2601,7 +2601,7 @@
26012601
"calendar": "japanese",
26022602
"locale": "ja-JP",
26032603
"input": "2000-01-01T00:00Z[Etc/GMT]",
2604-
"expected": "1/1 0時00分00秒 GMT"
2604+
"expected": "1/1 0:00:00 GMT"
26052605
},
26062606
{
26072607
"semanticSkeleton": "MDTZ",
@@ -2611,7 +2611,7 @@
26112611
"calendar": "japanese",
26122612
"locale": "ja-JP",
26132613
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
2614-
"expected": "1/1 0時00分00秒 アデレード時間"
2614+
"expected": "1/1 0:00:00 アデレード時間"
26152615
},
26162616
{
26172617
"semanticSkeleton": "MDTZ",
@@ -2621,7 +2621,7 @@
26212621
"calendar": "japanese",
26222622
"locale": "ja-JP",
26232623
"input": "2000-01-01T00:00Z[Etc/GMT]",
2624-
"expected": "1月1日 0時00分00秒 GMT"
2624+
"expected": "1月1日 0:00:00 GMT"
26252625
},
26262626
{
26272627
"semanticSkeleton": "MDTZ",
@@ -2631,7 +2631,7 @@
26312631
"calendar": "japanese",
26322632
"locale": "ja-JP",
26332633
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
2634-
"expected": "1月1日 0時00分00秒 アデレード時間"
2634+
"expected": "1月1日 0:00:00 アデレード時間"
26352635
},
26362636
{
26372637
"semanticSkeleton": "MDTZ",
@@ -2641,7 +2641,7 @@
26412641
"calendar": "japanese",
26422642
"locale": "ja-JP",
26432643
"input": "2000-01-01T00:00Z[Etc/GMT]",
2644-
"expected": "1/1 0時00分00秒 GMT"
2644+
"expected": "1/1 0:00:00 GMT"
26452645
},
26462646
{
26472647
"semanticSkeleton": "MDTZ",
@@ -2651,7 +2651,7 @@
26512651
"calendar": "japanese",
26522652
"locale": "ja-JP",
26532653
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
2654-
"expected": "1/1 0時00分00秒 アデレード時間"
2654+
"expected": "1/1 0:00:00 アデレード時間"
26552655
},
26562656
{
26572657
"semanticSkeleton": "MDTZ",
@@ -2661,7 +2661,7 @@
26612661
"calendar": "japanese",
26622662
"locale": "ja-JP",
26632663
"input": "2000-01-01T00:00Z[Etc/GMT]",
2664-
"expected": "1月1日 0時00分00秒 GMT"
2664+
"expected": "1月1日 0:00:00 GMT"
26652665
},
26662666
{
26672667
"semanticSkeleton": "MDTZ",
@@ -2671,7 +2671,7 @@
26712671
"calendar": "japanese",
26722672
"locale": "ja-JP",
26732673
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
2674-
"expected": "1月1日 0時00分00秒 アデレード時間"
2674+
"expected": "1月1日 0:00:00 アデレード時間"
26752675
},
26762676
{
26772677
"semanticSkeleton": "MDTZ",
@@ -2681,7 +2681,7 @@
26812681
"calendar": "japanese",
26822682
"locale": "ja-JP",
26832683
"input": "2000-01-01T00:00Z[Etc/GMT]",
2684-
"expected": "1/1 0時00分00秒 GMT"
2684+
"expected": "1/1 0:00:00 GMT"
26852685
},
26862686
{
26872687
"semanticSkeleton": "MDTZ",
@@ -2691,7 +2691,7 @@
26912691
"calendar": "japanese",
26922692
"locale": "ja-JP",
26932693
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
2694-
"expected": "1/1 0時00分00秒 GMT+10:30"
2694+
"expected": "1/1 0:00:00 GMT+10:30"
26952695
},
26962696
{
26972697
"semanticSkeleton": "MDTZ",
@@ -2701,7 +2701,7 @@
27012701
"calendar": "japanese",
27022702
"locale": "ja-JP",
27032703
"input": "2000-01-01T00:00Z[Etc/GMT]",
2704-
"expected": "1月1日 0時00分00秒 GMT"
2704+
"expected": "1月1日 0:00:00 GMT"
27052705
},
27062706
{
27072707
"semanticSkeleton": "MDTZ",
@@ -2711,7 +2711,7 @@
27112711
"calendar": "japanese",
27122712
"locale": "ja-JP",
27132713
"input": "2000-01-01T00:00+10:30[Australia/Adelaide]",
2714-
"expected": "1月1日 0時00分00秒 GMT+10:30"
2714+
"expected": "1月1日 0:00:00 GMT+10:30"
27152715
},
27162716
{
27172717
"semanticSkeleton": "M",

tools/cldr-code/src/main/java/org/unicode/cldr/tool/GenerateDateTimeTestData.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ static class FieldStyleComboInput {
562562
}
563563

564564
/**
565-
* @return The manually created collection of field input value combinatinos that characterize
565+
* @return The manually created collection of field input value combinations that characterize
566566
* the test cases of the kernel.
567567
*/
568568
private static ImmutableSet<FieldStyleComboInput> getFieldStyleComboInputs() {
@@ -1049,7 +1049,7 @@ public static String computeSkeletonFromSemanticSkeleton(
10491049
return sb.toString();
10501050
}
10511051

1052-
private static TestCase convertTestCaseInputToTestCase(
1052+
private static TestCase convertStylesTestCaseInputToTestCase(
10531053
ICUServiceBuilder icuServiceBuilder,
10541054
CLDRFile localeCldrFile,
10551055
TestCaseInput testCaseInput) {
@@ -1095,7 +1095,8 @@ private static TestCase computeTestCase(
10951095
TestCaseInput testCaseInput) {
10961096

10971097
if (testCaseInput.fieldStyleCombo.semanticSkeleton == null) {
1098-
return convertTestCaseInputToTestCase(icuServiceBuilder, localeCldrFile, testCaseInput);
1098+
return convertStylesTestCaseInputToTestCase(
1099+
icuServiceBuilder, localeCldrFile, testCaseInput);
10991100
} else {
11001101
String calendarStr = testCaseInput.calendar.getType();
11011102
String skeleton =
@@ -1107,7 +1108,7 @@ private static TestCase computeTestCase(
11071108
// compute the expected
11081109
// TODO: fix CLDR DateTimeFormats constructor to use CLDRFile to get the dateTimeFormat
11091110
// glue pattern rather than use ICU to get it
1110-
DateTimeFormats formats = new DateTimeFormats().set(localeCldrFile, calendarStr);
1111+
DateTimeFormats formats = new DateTimeFormats().set(localeCldrFile, calendarStr, false);
11111112
SimpleDateFormat formatterForSkeleton = formats.getDateFormatFromSkeleton(skeleton);
11121113
formatterForSkeleton.setCalendar(testCaseInput.calendar);
11131114
formatterForSkeleton.setTimeZone(testCaseInput.timeZone);

tools/cldr-code/src/main/java/org/unicode/cldr/util/DateTimeFormats.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,7 @@ public DateTimeFormats set(CLDRFile file, String calendarID) {
181181
public DateTimeFormats set(CLDRFile file, String calendarID, boolean useStock) {
182182
this.file = file;
183183
locale = new ULocale(file.getLocaleID());
184-
if (useStock) {
185-
icuServiceBuilder = new ICUServiceBuilder().setCldrFile(file);
186-
}
184+
icuServiceBuilder = new ICUServiceBuilder().setCldrFile(file);
187185
PatternInfo returnInfo = new PatternInfo();
188186
generator = DateTimePatternGenerator.getEmptyInstance();
189187
this.calendarID = calendarID;

0 commit comments

Comments
 (0)