Skip to content

Commit

Permalink
Upgrade to cldr 1.8.2, fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
phensley committed Nov 11, 2024
1 parent 628ff07 commit 1923208
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .sdkmanrc
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
java=11.0.20-zulu
java=11.0.25-zulu

2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ wrapper {

project.ext {
argparseVersion = '0.4.4'
cldrengineVersion = '1.2.17'
cldrengineVersion = '1.8.2'
diffutilsVersion = '1.3.0'
hamcrestVersion = '2.1'
jacksonVersion = '2.3.3'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ public static String diff(String expected, String actual) {
buf.append("@@ -" + pos1 + "," + lines1.size());
buf.append(" +" + pos2 + "," + lines2.size()).append(" @@\n");
for (String row : lines1) {
buf.append("- ").append(escaped(row)).append('\n');
buf.append("- ").append(row).append('\n');
}
for (String row : lines2) {
buf.append("+ ").append(escaped(row)).append('\n');
buf.append("+ ").append(row).append('\n');
}
}
return buf.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void testSingleFields() throws CodeException {

// Month of year, short, locale-adjusted
assertEquals(formatDate("%h", MAY_13_2013_010000_UTC, TZ_UTC, Locale.GERMANY), "Mai");
assertEquals(formatDate("%h", MAY_13_2013_010000_UTC, TZ_UTC, MEXICO), "may.");
assertEquals(formatDate("%h", MAY_13_2013_010000_UTC, TZ_UTC, MEXICO), "may");

// Hour of day, 12-hour
assertEquals(formatDate("%I", JAN_01_1970_071510_UTC, TZ_NY), "02");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,28 +79,28 @@ public void testDateTimeFormatter() throws Exception {
// ENGLISH

assertEquals(format(en_US, DATETIME, mk.args(""), json), "November 2, 2017");
assertEquals(format(en_US, DATETIME, mk.args(" short"), json), "11/2/17, 2:26 PM");
assertEquals(format(en_US, DATETIME, mk.args(" long"), json), "November 2, 2017 at 2:26:57 PM EDT");
assertEquals(format(en_US, DATETIME, mk.args(" short"), json), "11/2/17, 2:26PM");
assertEquals(format(en_US, DATETIME, mk.args(" long"), json), "November 2, 2017 at 2:26:57PM EDT");

assertEquals(format(en_US, DATETIME, mk.args(" date"), json), "11/2/17");
assertEquals(format(en_US, DATETIME, mk.args(" date:short"), json), "11/2/17");
assertEquals(format(en_US, DATETIME, mk.args(" time"), json), "2:26 PM");
assertEquals(format(en_US, DATETIME, mk.args(" time:medium"), json), "2:26:57 PM");
assertEquals(format(en_US, DATETIME, mk.args(" time"), json), "2:26PM");
assertEquals(format(en_US, DATETIME, mk.args(" time:medium"), json), "2:26:57PM");
assertEquals(format(en_US, DATETIME, mk.args(" date:full time:short"), json),
"Thursday, November 2, 2017 at 2:26 PM");
"Thursday, November 2, 2017 at 2:26PM");

assertEquals(format(en_US, DATETIME, mk.args(" time:hm date:short"), json), "11/2/17, 2:26 PM");
assertEquals(format(en_US, DATETIME, mk.args(" date:yMMMd time:hm"), json), "Nov 2, 2017, 2:26 PM");
assertEquals(format(en_US, DATETIME, mk.args(" time:hm date:short"), json), "11/2/17, 2:26PM");
assertEquals(format(en_US, DATETIME, mk.args(" date:yMMMd time:hm"), json), "Nov 2, 2017, 2:26PM");

assertEquals(format(en_US, DATETIME, mk.args(" date:yMMMd time:medium wrap:short"), json),
"Nov 2, 2017, 2:26:57 PM");
"Nov 2, 2017, 2:26:57PM");
assertEquals(format(en_US, DATETIME, mk.args(" time:medium wrap:full date:yMMMd"), json),
"Nov 2, 2017 at 2:26:57 PM");
"Nov 2, 2017 at 2:26:57PM");

// Bare skeletons

assertEquals(format(en_US, DATETIME, mk.args(" date:short hm"), json), "11/2/17, 2:26 PM");
assertEquals(format(en_US, DATETIME, mk.args(" yMMMd hm"), json), "Nov 2, 2017, 2:26 PM");
assertEquals(format(en_US, DATETIME, mk.args(" date:short hm"), json), "11/2/17, 2:26PM");
assertEquals(format(en_US, DATETIME, mk.args(" yMMMd hm"), json), "Nov 2, 2017, 2:26PM");


// FRENCH
Expand All @@ -110,8 +110,8 @@ public void testDateTimeFormatter() throws Exception {
assertEquals(format(fr, DATETIME, mk.args(" date:full time:short"), json),
"jeudi 2 novembre 2017 à 14:26");

assertEquals(format(fr, DATETIME, mk.args(" time:hm date:short"), json), "02/11/2017 2:26 PM");
assertEquals(format(fr, DATETIME, mk.args(" date:yMMMd time:hm"), json), "2 nov. 2017 à 2:26 PM");
assertEquals(format(fr, DATETIME, mk.args(" time:hm date:short"), json), "02/11/2017 2:26PM");
assertEquals(format(fr, DATETIME, mk.args(" date:yMMMd time:hm"), json), "2 nov. 2017, 2:26PM");

assertEquals(format(fr, DATETIME, mk.args(" date:yMMMd time:medium wrap:short"), json),
"2 nov. 2017 14:26:57");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public void testDateTime() {
long epoch = 1582129775000L;

actual = formats.formatter().format(message, args().add(new LongNode(epoch)));
assertEquals(actual, "February 19, 2020 at 11:29:35 AM");
assertEquals(actual, "February 19, 2020 at 11:29:35AM");
}

@Test
Expand All @@ -198,7 +198,7 @@ public void testInterval() {
long extra = 86400000 + 3600000;
MessageArgs args = args().add(new LongNode(epoch)).add(new LongNode(epoch + extra));
actual = formats.formatter().format(message, args);
assertEquals(actual, "Feb 1920, 2020");
assertEquals(actual, "Feb 19 – 20, 2020");
}

private ObjectNode money(String value, String currency) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
{start, end|datetime-interval yMMMd}{.end}

:OUTPUT
Nov 213, 2017
10:00 AM – 12:00 PM
Nov 2 – 13, 2017
10:00 AM – 12:00PM

Nov 213, 2017
Nov 2 – 13, 2017
Aug 9, 2017
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
}

:TEMPLATE
{.repeated section events}
{.repeated section events}
{messages.event|message s e}{.end}

:OUTPUT
The event will take place May 1Jul 15, 2018.
The event will take place 7:00 AM – 1:00 PM.
The event will take place May 1 – Jul 15, 2018.
The event will take place 7:00 AM – 1:00PM.
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
}

:TEMPLATE
{.repeated section events}
{.repeated section events}
{messages.event|message s e}{.end}

:OUTPUT
The event will take place 1 mai15 juil. 2018.
The event will take place 7:00 AM – 1:00 PM.
The event will take place 1 mai – 15 juil. 2018.
The event will take place 7:00 AM – 1:00PM.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@
10
Monday, February 10, 2020
February 10, 2020
February 10, 2020 at 2:07 PM ET
February 10, 2020 at 2:07PM ET
Feb 10, 2020
2/10/20
Mon, Feb 10, 2020
2:07 PM
2:07PM
2020
February 2020
Feb 10, 2020
Feb 10, 2020, 2:07 PM
Feb 10, 2020, 2:07PM
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version=2.9.11-SNAPSHOT
version=2.10.0-SNAPSHOT

0 comments on commit 1923208

Please sign in to comment.