]> granicus.if.org Git - icu/commitdiff
ICU-20347 Update ICU4J test to reflect expected behavior
authorPeter Edberg <pedberg@unicode.org>
Wed, 6 Feb 2019 07:29:46 +0000 (23:29 -0800)
committerpedberg-icu <42151464+pedberg-icu@users.noreply.github.com>
Wed, 6 Feb 2019 08:22:47 +0000 (00:22 -0800)
icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatTest.java

index 2079bdebdf5d8889fa19936f90cb569ebde7df59..bb951e8a0002601485587ebd191f44fbba9d888d 100644 (file)
@@ -1738,10 +1738,13 @@ public class NumberFormatTest extends TestFmwk {
         Number value = null;
         try {
             value = numfmt.parse(parsetxt, ppos);
-            // Currently this succeeds (no exception) but returns null (for value).
-            logln("NumberFormat.parse empty string succeeds, ppos " + ppos.getIndex() + ", value " + value);
+            if (value==null) {
+                logln("NumberFormat.parse empty string succeeds (no exception) with null return as expected, ppos " + ppos.getIndex());
+            } else {
+                errln("NumberFormat.parse empty string succeeds (no exception) but returns non-null value " + value + ", ppos " + ppos.getIndex());
+            }
         } catch (IllegalArgumentException e){
-            logln("NumberFormat.parse empty string sets IllegalArgumentException, ppos " + ppos.getIndex() + ", value " + value);
+            errln("NumberFormat.parse empty string throws IllegalArgumentException");
         }
      }