Skip to content

Commit b9945a8

Browse files
authored
CLDR-14996 Test for forbidden time formats in en_001 (unicode-org#4626)
1 parent 3ff42ca commit b9945a8

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
package org.unicode.cldr.test;
2+
3+
import static org.junit.jupiter.api.Assertions.assertFalse;
4+
5+
import org.junit.jupiter.api.Test;
6+
import org.unicode.cldr.util.*;
7+
8+
public class TestEn001Time {
9+
10+
// TODO: for short timezone names, check that en_001 has “∅∅∅” iff en has a value, and
11+
// that en_001 otherwise has no short timezone names (except through inheritance).
12+
// Reference: https://unicode-org.atlassian.net/browse/CLDR-14996
13+
static final boolean CHECK_SHORT_TIMEZONE_NAMES = false;
14+
static final String TIME_FORMAT_PREFIX =
15+
"//ldml/dates/calendars/calendar[@type=\"gregorian\"]/timeFormats/timeFormatLength";
16+
17+
static final String TIMEZONE_NAME_PREFIX = "//ldml/dates/timeZoneNames";
18+
static final String TIMEZONE_NAME_SHORT = "short";
19+
20+
/** en_001 should not have standard time formats */
21+
@Test
22+
void testTime() {
23+
Factory factory = CLDRConfig.getInstance().getCommonAndSeedAndMainAndAnnotationsFactory();
24+
CLDRFile cldrFile = factory.make("en_001", false);
25+
for (final String path : cldrFile.fullIterable()) {
26+
assertFalse(
27+
path.startsWith(TIME_FORMAT_PREFIX),
28+
"Path starts with " + TIME_FORMAT_PREFIX + ": " + path);
29+
if (CHECK_SHORT_TIMEZONE_NAMES) {
30+
assertFalse(
31+
path.startsWith(TIMEZONE_NAME_PREFIX) && path.contains(TIMEZONE_NAME_SHORT),
32+
"Path starts with "
33+
+ TIMEZONE_NAME_PREFIX
34+
+ " + and contains "
35+
+ TIMEZONE_NAME_SHORT
36+
+ ": "
37+
+ path);
38+
}
39+
}
40+
}
41+
}

0 commit comments

Comments
 (0)