]> granicus.if.org Git - icu/commitdiff
ICU-13148 Adding known-issue test case for #13148
authorShane Carr <shane@unicode.org>
Tue, 2 May 2017 00:09:16 +0000 (00:09 +0000)
committerShane Carr <shane@unicode.org>
Tue, 2 May 2017 00:09:16 +0000 (00:09 +0000)
X-SVN-Rev: 40094

icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java

index 9a791a7722bfece91679de01413bb579b58b6c48..cd118f610b099c778c9773d9fb6ef8f8f026354e 100644 (file)
@@ -5034,6 +5034,19 @@ public class NumberFormatTest extends TestFmwk {
         }
     }
 
+    @Test
+    public void Test13148() {
+        if (logKnownIssue("13148", "Currency separators used in non-currency parsing")) return;
+        DecimalFormat fmt = (DecimalFormat)NumberFormat.getInstance(new ULocale("en", "ZA"));
+        DecimalFormatSymbols symbols = fmt.getDecimalFormatSymbols();
+        symbols.setDecimalSeparator('.');
+        symbols.setGroupingSeparator(',');
+        fmt.setDecimalFormatSymbols(symbols);
+        ParsePosition ppos = new ParsePosition(0);
+        Number number = fmt.parse("300,000", ppos);
+        assertEquals("Should parse to 300000 using non-monetary separators: " + ppos, 300000L, number);
+    }
+
     @Test
     public void testPercentZero() {
         DecimalFormat df = (DecimalFormat) NumberFormat.getPercentInstance();