Skip to content

Commit bf67c38

Browse files
committed
CLDR-18881 Add test illustrating current behavior
1 parent 71b9755 commit bf67c38

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

icu4j/main/core/src/test/java/com/ibm/icu/dev/test/format/DateTimeGeneratorTest.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2077,4 +2077,15 @@ public void testAlphabeticSubstitution23114() {
20772077
String bestPattern = dtpg.getBestPattern("GyMEd");
20782078
assertEquals("Should not substitute numeric for alpha", "EEE, MMM d, y G", bestPattern);
20792079
}
2080+
2081+
@Test
2082+
public void testTimePatternSelection18881() {
2083+
DateTimePatternGenerator dtpg0 = DateTimePatternGenerator.getInstance(ULocale.forLanguageTag("th"));
2084+
String bestPattern = dtpg0.getBestPattern("MMMMdjmsO");
2085+
assertEquals("getInstance", "d MMMM เวลา H นาฬิกา mm นาที ss วินาที O", bestPattern);
2086+
2087+
DateTimePatternGenerator dtpg1 = DateTimePatternGenerator.getInstanceNoStdPat(ULocale.forLanguageTag("th"));
2088+
bestPattern = dtpg1.getBestPattern("MMMMdjmsO");
2089+
assertEquals("getInstanceNoStdPat", "d MMMM HH:mm:ss O", bestPattern);
2090+
}
20802091
}

0 commit comments

Comments
 (0)