]> granicus.if.org Git - icu/commitdiff
ICU-13461 Making AffixUtilsTest independent of locale data changes.
authorShane Carr <shane@unicode.org>
Thu, 2 Nov 2017 01:07:38 +0000 (01:07 +0000)
committerShane Carr <shane@unicode.org>
Thu, 2 Nov 2017 01:07:38 +0000 (01:07 +0000)
X-SVN-Rev: 40666

icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/AffixUtilsTest.java

index d796d7e1329716754352e06e6082cbf0396c964b..fe77028a44f59c3ec0e76ff4544a0184bc08c237 100644 (file)
@@ -10,28 +10,24 @@ import org.junit.Test;
 import com.ibm.icu.impl.number.AffixUtils;
 import com.ibm.icu.impl.number.AffixUtils.SymbolProvider;
 import com.ibm.icu.impl.number.NumberStringBuilder;
-import com.ibm.icu.text.DecimalFormatSymbols;
-import com.ibm.icu.util.ULocale;
 
 public class AffixUtilsTest {
 
     private static final SymbolProvider DEFAULT_SYMBOL_PROVIDER =
         new SymbolProvider() {
-          // ar_SA has an interesting percent sign and various Arabic letter marks
-          private final DecimalFormatSymbols SYMBOLS =
-              DecimalFormatSymbols.getInstance(new ULocale("ar_SA"));
-
           @Override
           public CharSequence getSymbol(int type) {
+            // Use interesting symbols where possible. The symbols are from ar_SA but are hard-coded
+            // here to make the test independent of locale data changes.
             switch (type) {
               case AffixUtils.TYPE_MINUS_SIGN:
                 return "−";
               case AffixUtils.TYPE_PLUS_SIGN:
-                return SYMBOLS.getPlusSignString();
+                return "\u061C+";
               case AffixUtils.TYPE_PERCENT:
-                return SYMBOLS.getPercentString();
+                return "٪\u061C";
               case AffixUtils.TYPE_PERMILLE:
-                return SYMBOLS.getPerMillString();
+                return "؉";
               case AffixUtils.TYPE_CURRENCY_SINGLE:
                 return "$";
               case AffixUtils.TYPE_CURRENCY_DOUBLE: