1 package org.unicode.cldr.unittest;
2 
3 import org.unicode.cldr.util.CLDRPaths;
4 import org.unicode.cldr.util.SupplementalDataInfo;
5 import org.unicode.cldr.util.UExtension;
6 
7 import com.ibm.icu.dev.test.TestFmwk;
8 import com.ibm.icu.impl.Relation;
9 
10 public class TestUExtension extends TestFmwk {
11 
12     static SupplementalDataInfo data = SupplementalDataInfo
13         .getInstance(CLDRPaths.SUPPLEMENTAL_DIRECTORY);
14 
main(String[] args)15     public static void main(String[] args) {
16         new TestUExtension().run(args);
17     }
18 
TestBasic()19     public void TestBasic() {
20         Relation<String, String> validKeyTypes = data.getBcp47Keys();
21         for (String key : validKeyTypes.keySet()) {
22             logln(key + "\t" + validKeyTypes.getAll(key));
23         }
24 
25         UExtension uExtension;
26 
27         uExtension = new UExtension().parse("ca-buddhist-co-dict");
28         assertTrue("", uExtension.getKeys().contains("co"));
29         logln("ca-buddhist-co-dict" + "\t" + uExtension);
30 
31         uExtension = new UExtension().parse("vt-12345-0061");
32         assertTrue("", uExtension.getKeys().contains("vt"));
33         logln("vt-12345" + "\t" + uExtension);
34 
35         uExtension = new UExtension().parse("vt-1");
36     }
37 }
38