]> granicus.if.org Git - icu/commitdiff
ICU-9839 Added TestEnglishExemplarCharacter which was added in ICU4C with this ticket...
authorYoshito Umaoka <y.umaoka@gmail.com>
Fri, 18 Jan 2013 16:57:09 +0000 (16:57 +0000)
committerYoshito Umaoka <y.umaoka@gmail.com>
Fri, 18 Jan 2013 16:57:09 +0000 (16:57 +0000)
X-SVN-Rev: 33063

icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/LocaleDataTest.java

index 9a6db85d9a560435dcd61c1a53b1f5b360dd5616..c64c707f560eba8418548492d8a0af2db8450cad 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *******************************************************************************
- * Copyright (C) 2003-2012, International Business Machines Corporation and    *
+ * Copyright (C) 2003-2013, International Business Machines Corporation and    *
  * others. All Rights Reserved.                                                *
  *******************************************************************************
 */
@@ -96,7 +96,27 @@ public class LocaleDataTest extends TestFmwk{
             }
         }
     }
-    
+
+    // Simple test case for checking exemplar character type coverage
+    public void TestEnglishExemplarCharacters() {
+        final char[] testChars = {
+            0x61,   // standard
+            0xE1,   // auxiliary
+            0x41,   // index
+            0,      // filler for deprecated currency exemplar
+            0x2D,   // punctuation
+        };
+        LocaleData ld = LocaleData.getInstance(ULocale.ENGLISH);
+        for (int type = 0; type < LocaleData.ES_COUNT; type++) {
+            UnicodeSet exSet = ld.getExemplarSet(0, type);
+            if (exSet != null) {
+                if (testChars[type] > 0 && !exSet.contains(testChars[type])) {
+                    errln("Character '" + testChars[type] + "' is not included in exemplar type " + type);
+                }
+            }
+        }
+    }
+
     // Bundle together a UnicodeSet (of expemplars) and ScriptCode combination.
     //   We keep a set of combinations that have already been tested, to
     //   avoid repeated (time consuming) retesting of the same data.