From: Yoshito Umaoka Date: Fri, 18 Jan 2013 16:57:09 +0000 (+0000) Subject: ICU-9839 Added TestEnglishExemplarCharacter which was added in ICU4C with this ticket... X-Git-Tag: milestone-59-0-1~3206 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=68d9cedfa86bfa4517a8557b937272b0f7f32887;p=icu ICU-9839 Added TestEnglishExemplarCharacter which was added in ICU4C with this ticket. No API/library code change in ICU4J, because punctuation exemplar is already supported. X-SVN-Rev: 33063 --- diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/LocaleDataTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/LocaleDataTest.java index 9a6db85d9a5..c64c707f560 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/LocaleDataTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/util/LocaleDataTest.java @@ -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.