1 // 2016 and later: Unicode, Inc. and others. 2 // License & terms of use: http://www.unicode.org/copyright.html#License 3 /** 4 ******************************************************************************* 5 * Copyright (C) 1996-2006, International Business Machines Corporation and * 6 * others. All Rights Reserved. * 7 ******************************************************************************* 8 */ 9 package com.ibm.icu.dev.test.lang; 10 import org.junit.Test; 11 import org.junit.runner.RunWith; 12 import org.junit.runners.JUnit4; 13 14 import com.ibm.icu.dev.test.TestFmwk; 15 import com.ibm.icu.lang.UCharacterCategory; 16 17 /** 18 * Testing UCharacterCategory 19 * @author Syn Wee Quek 20 * @since April 02 2002 21 */ 22 @RunWith(JUnit4.class) 23 public class UCharacterCategoryTest extends TestFmwk 24 { 25 // constructor ----------------------------------------------------------- 26 27 /** 28 * Private constructor to prevent initialisation 29 */ 30 public UCharacterCategoryTest() 31 { 32 } 33 34 // public methods -------------------------------------------------------- 35 36 /** 37 * Gets the name of the argument category 38 * @returns category name 39 */ 40 @Test 41 public void TestToString() 42 { 43 String name[] = {"Unassigned", 44 "Letter, Uppercase", 45 "Letter, Lowercase", 46 "Letter, Titlecase", 47 "Letter, Modifier", 48 "Letter, Other", 49 "Mark, Non-Spacing", 50 "Mark, Enclosing", 51 "Mark, Spacing Combining", 52 "Number, Decimal Digit", 53 "Number, Letter", 54 "Number, Other", 55 "Separator, Space", 56 "Separator, Line", 57 "Separator, Paragraph", 58 "Other, Control", 59 "Other, Format", 60 "Other, Private Use", 61 "Other, Surrogate", 62 "Punctuation, Dash", 63 "Punctuation, Open", 64 "Punctuation, Close", 65 "Punctuation, Connector", 66 "Punctuation, Other", 67 "Symbol, Math", 68 "Symbol, Currency", 69 "Symbol, Modifier", 70 "Symbol, Other", 71 "Punctuation, Initial quote", 72 "Punctuation, Final quote"}; 73 for (int i = UCharacterCategory.UNASSIGNED; 74 i < UCharacterCategory.CHAR_CATEGORY_COUNT; i ++) { 75 if (!UCharacterCategory.toString(i).equals(name[i])) { 76 errln("Error toString for category " + i + " expected " + 77 name[i]); 78 } 79 } 80 } 81 } 82