File tree 1 file changed +41
-0
lines changed
tools/cldr-code/src/test/java/org/unicode/cldr/test
1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
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
+ }
You can’t perform that action at this time.
0 commit comments