• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 package org.unicode.cldr.unittest;
2 
3 import org.unicode.cldr.test.CasingInfo;
4 
5 import com.ibm.icu.dev.test.TestFmwk;
6 
7 public class TestCasingInfo extends TestFmwk {
main(String[] args)8     public static void main(String[] args) {
9         new TestCasingInfo().run(args);
10     }
11 
TestGetLocaleCasing()12     public void TestGetLocaleCasing() {
13         CasingInfo casingInfo = new CasingInfo();
14         assertNull("Casing info shouldn't exist for imaginary locale",
15             casingInfo.getLocaleCasing("xyz"));
16         assertNotEquals(
17             "Casing should not be the same for different languages",
18             casingInfo.getLocaleCasing("en"),
19             casingInfo.getLocaleCasing("pt"));
20         assertEquals("regional casing should default to country",
21             casingInfo.getLocaleCasing("en"),
22             casingInfo.getLocaleCasing("en_AU"));
23         // The following test is no longer valid with cldrbug 8757
24         //assertNotEquals("pt_PT is a special case and should not default to pt",
25         //    casingInfo.getLocaleCasing("pt"),
26         //    casingInfo.getLocaleCasing("pt_PT"));
27         assertNotEquals("Script variants should have their own casing",
28             casingInfo.getLocaleCasing("uz"),
29             casingInfo.getLocaleCasing("uz_Cyrl"));
30         assertEquals(
31             "Casing for regional variants of a script should be the same as the script variant",
32             casingInfo.getLocaleCasing("zh_Hant_TW"),
33             casingInfo.getLocaleCasing("zh_Hant"));
34     }
35 }
36