From: Shane Carr Date: Thu, 17 May 2018 05:54:12 +0000 (+0000) Subject: ICU-13740 Enabling proper ICU4J test. X-Git-Tag: release-62-rc~85 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=afa3cb0819f04ad43c5c5b345cffe7b2a7842080;p=icu ICU-13740 Enabling proper ICU4J test. X-SVN-Rev: 41400 --- diff --git a/icu4c/source/test/testdata/numberformattestspecification.txt b/icu4c/source/test/testdata/numberformattestspecification.txt index 030f1259e8a..35775a5e0bd 100644 --- a/icu4c/source/test/testdata/numberformattestspecification.txt +++ b/icu4c/source/test/testdata/numberformattestspecification.txt @@ -393,11 +393,11 @@ format maxIntegerDigits output breaks // C obeys maxIntegerDigits and prints after the decimal place 0 0 .0 HKQ // C and Q ignore max integer if it is less than zero and prints "123" -123 -2147483648 0 CQ +123 -2147483648 0 CJQ 12345 1 5 -12345 -2147483648 0 CQ +12345 -2147483648 0 CJQ 5.3 1 5.3 -5.3 -2147483648 .3 CQ +5.3 -2147483648 .3 CJQ test patterns with zero set locale en @@ -484,10 +484,10 @@ begin format multiplier output breaks 23 -12 -276 23 -1 -23 -// H (ICU4J 58) throws exception on zero multiplier. +// H (ICU4J 58) and J (current ICU4J) throw exception on zero multiplier. // ICU4C prints 23. // Q multiplies by zero and prints 0. -23 0 0 CH +23 0 0 CHJ 23 1 23 23 12 276 -23 12 -276 @@ -502,8 +502,8 @@ format output breaks -0.35 -0.25 K 0.35 0.25 K // Q doesn't support mixing minFrac with roundingIncrement (prints 0.50). -0.39 0.5 KQ -0.62 0.5 KQ +0.39 0.5 JKQ +0.62 0.5 JKQ 0.63 0.75 K test padding setters @@ -706,19 +706,19 @@ pattern toPattern breaks **0,000 **0,000 HK **##0,000 **##0,000 K **###0,000 **###0,000 K -**####0,000 **#,##0,000 CKS +**####0,000 **#,##0,000 CJKS ###,000. #,000. -0,000 #0,000 CS +0,000 #0,000 CJS .00 #.00 -000 #000 CS -000,000 #,000,000 CS +000 #000 CJS +000,000 #,000,000 CJS pp#,000 pp#,000 -00.## #00.## CS +00.## #00.## CJS #,#00.025 #,#00.025 // No secondary grouping in JDK #,##,###.02500 #,##,###.02500 K pp#,000;(#) pp#,000;(#,000) K -**####,##,##0.0##;(#) **#,##,##,##0.0##;**(##,##,##0.0##) CKS +**####,##,##0.0##;(#) **#,##,##,##0.0##;**(##,##,##0.0##) CJKS // No significant digits in JDK @@### @@### K @,@#,### @,@#,### K @@ -754,7 +754,7 @@ parse output breaks (34 25E-1) -342.5 K (34,,25E-1) -342.5 // H doesn't allow trailing separators before E but C and P do -(34,,25,E-1) -342.5 CHP +(34,,25,E-1) -342.5 CHJP (34 25 E-1) -342.5 HK (34,,25 E-1) -342.5 HK // Spaces are not allowed after exponent symbol @@ -817,7 +817,7 @@ parse output breaks 1,234,,,+ 1234 HK 1,234- -1234 // H, C, and P bail because of trailing separators -1,234,- -1234 CHP +1,234,- -1234 CHJP // J bails here too 1234 - -1234 H @@ -961,13 +961,10 @@ set negativePrefix set negativeSuffix 9N begin parse output breaks -// S is the only implementation that passes these cases. -// C and P consume the '9' as a digit and assumes number is negative -// H and JDK bail -6549K 654 CHKP -// C and P consume the '9' as a digit and assumes number is negative -// H and JDK bail -6549N -654 CHKP +// A non-greedy parse is required to pass these cases. +// All of the implementations being tested are greedy. +6549K 654 CHJKP +6549N -654 CHJKP test really strange prefix set locale en @@ -1033,7 +1030,7 @@ begin parse output outputCurrency breaks 53.45 fail GBP £53.45 53.45 GBP -$53.45 fail USD HP +$53.45 fail USD HJP 53.45 USD 53.45 USD 53.45 GBP 53.45 GBP USD 53.45 53.45 USD H @@ -1051,7 +1048,7 @@ USD(7.92) -7.92 USD H (8) USD -8 USD -8 USD -8 USD 67 USD 67 USD -53.45$ fail USD P +53.45$ fail USD JP US Dollars 53.45 53.45 USD H 53.45 US Dollars 53.45 USD US Dollar 53.45 53.45 USD H @@ -1080,7 +1077,7 @@ begin parse output outputCurrency breaks 53.45 fail GBP £53.45 53.45 GBP -$53.45 fail USD HP +$53.45 fail USD HJP 53.45 USD 53.45 USD 53.45 GBP 53.45 GBP USD 53.45 53.45 USD H @@ -1094,7 +1091,7 @@ USD -7.926 -7.926 USD H USD-7.92 -7.92 USD H -8 USD -8 USD 67 USD 67 USD -53.45$ fail USD P +53.45$ fail USD JP US Dollars 53.45 53.45 USD H 53.45 US Dollars 53.45 USD US Dollar 53.45 53.45 USD H @@ -1114,7 +1111,7 @@ parse output outputCurrency breaks // J throws a NullPointerException on the first case 53.45 fail GBP £53.45 53.45 GBP -$53.45 fail USD HP +$53.45 fail USD HJP 53.45 USD 53.45 USD 53.45 GBP 53.45 GBP USD 53.45 53.45 USD H @@ -1133,7 +1130,7 @@ USD(7.92) -7.92 USD H -8 USD -8 USD 67 USD 67 USD // J throws a NullPointerException on the next case -53.45$ fail USD P +53.45$ fail USD JP US Dollars 53.45 53.45 USD H 53.45 US Dollars 53.45 USD US Dollar 53.45 53.45 USD H @@ -1152,7 +1149,7 @@ begin parse output outputCurrency breaks 53.45 fail GBP £53.45 53.45 GBP -$53.45 fail USD HP +$53.45 fail USD HJP 53.45 USD 53.45 USD 53.45 GBP 53.45 GBP USD 53.45 53.45 USD H @@ -1170,7 +1167,7 @@ USD(7.92) -7.92 USD H (8) USD -8 USD -8 USD -8 USD 67 USD 67 USD -53.45$ fail USD P +53.45$ fail USD JP US Dollars 53.45 53.45 USD H 53.45 US Dollars 53.45 USD US Dollar 53.45 53.45 USD H @@ -1189,26 +1186,26 @@ begin parse output outputCurrency breaks 53.45 fail GBP £53.45 53.45 GBP -$53.45 fail USD HP +$53.45 fail USD HJP 53.45 USD 53.45 USD 53.45 GBP 53.45 GBP USD 53.45 53.45 USD H 53.45USD 53.45 USD H USD53.45 53.45 USD // C and P fail these because '(' is an incomplete prefix. -(7.92) USD -7.92 USD CHP -(7.92) GBP -7.92 GBP CHP -(7.926) USD -7.926 USD CHP -(7.926 USD) -7.926 USD CHP +(7.92) USD -7.92 USD CHJP +(7.92) GBP -7.92 GBP CHJP +(7.926) USD -7.926 USD CHJP +(7.926 USD) -7.926 USD CHJP (USD 7.926) -7.926 USD H -USD (7.926) -7.926 USD CHP -USD (7.92) -7.92 USD CHP -(7.92)USD -7.92 USD CHP -USD(7.92) -7.92 USD CHP -(8) USD -8 USD CHP +USD (7.926) -7.926 USD CHJP +USD (7.92) -7.92 USD CHJP +(7.92)USD -7.92 USD CHJP +USD(7.92) -7.92 USD CHJP +(8) USD -8 USD CHJP -8 USD -8 USD 67 USD 67 USD -53.45$ fail USD P +53.45$ fail USD JP US Dollars 53.45 53.45 USD H 53.45 US Dollars 53.45 USD US Dollar 53.45 53.45 USD H @@ -1235,10 +1232,10 @@ parse output outputCurrency breaks \u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR // P fails here because this currency name is in the Trie only, but it has the same prefix as the non-Trie currency -\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CP +\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP IRR 1235 1235 IRR \u0631\u06cc\u0627\u0644 1235 1235 IRR -\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CP +\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP test parse foreign currency ISO set pattern \u00a4\u00a4 0.00;\u00a4\u00a4 -# @@ -1247,10 +1244,10 @@ begin parse output outputCurrency breaks \u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR -\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CP +\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP IRR 1235 1235 IRR \u0631\u06cc\u0627\u0644 1235 1235 IRR -\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CP +\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP test parse foreign currency full set pattern \u00a4\u00a4\u00a4 0.00;\u00a4\u00a4\u00a4 -# @@ -1259,10 +1256,10 @@ begin parse output outputCurrency breaks \u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR -\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CP +\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP IRR 1235 1235 IRR \u0631\u06cc\u0627\u0644 1235 1235 IRR -\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CP +\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP test parse currency with foreign symbols symbol english set pattern \u00a4 0.00;\u00a4 (#) @@ -1304,10 +1301,10 @@ begin parse currency output breaks $52.41 USD 52.41 USD52.41 USD 52.41 K -\u20ac52.41 USD fail CP -EUR52.41 USD fail CP -$52.41 EUR fail CP -USD52.41 EUR fail CP +\u20ac52.41 USD fail CJP +EUR52.41 USD fail CJP +$52.41 EUR fail CJP +USD52.41 EUR fail CJP \u20ac52.41 EUR 52.41 K EUR52.41 EUR 52.41 @@ -1317,11 +1314,11 @@ set locale en_US set lenient 0 begin parse output outputCurrency breaks -$53.45 53.45 USD CP +$53.45 53.45 USD CJP 53.45 USD 53.45 USD USD 53.45 fail USD 53.45USD fail USD -USD53.45 53.45 USD CP +USD53.45 53.45 USD CJP (7.92) USD -7.92 USD (7.92) EUR -7.92 EUR (7.926) USD -7.926 USD @@ -1339,9 +1336,9 @@ US Dollars 53.45 fail USD 53.45 US Dollars 53.45 USD US Dollar 53.45 fail USD 53.45 US Dollar 53.45 USD -US Dollars53.45 53.45 USD CP +US Dollars53.45 53.45 USD CJP 53.45US Dollars fail USD -US Dollar53.45 53.45 USD CP +US Dollar53.45 53.45 USD CJP US Dollat53.45 fail USD 53.45US Dollar fail USD US Dollars (53.45) fail USD @@ -1433,13 +1430,13 @@ NaN NaN K -1E-99999999999999 -0.0 1E2147483648 Inf K 1E2147483647 Inf K -// H and K get Infinity -1E2147483646 1E+2147483646 HK +// H, J and K get Infinity +1E2147483646 1E+2147483646 HJK 1E-2147483649 0 1E-2147483648 0 // H, K, C and P return zero here -1E-2147483647 1E-2147483647 CHKP -1E-2147483646 1E-2147483646 HK +1E-2147483647 1E-2147483647 CHJKP +1E-2147483646 1E-2147483646 HJK test format push limits set locale en @@ -1511,7 +1508,7 @@ y g h56 -56 HK 56i j‎k -56 HK 56‎i jk -56 HK // S and C get 56 (accepts ' ' gs grouping); H and K get null -5 6 fail CP +5 6 fail CJP 5‎6 5 HK test parse spaces in grouping @@ -1522,8 +1519,8 @@ set pattern #,##0 begin parse output breaks // C, H, S, and P get "12" here -1 2 1 CHP -1 23 1 CHP +1 2 1 CHJP +1 23 1 CHJP // K gets 1 here; doesn't pick up the grouping separator 1 234 1234 K @@ -1538,7 +1535,7 @@ format output breaks // C and J get "1" // Q gets "1.0" // K gets "1.1" (??) -0.975 0.98 CHKQ +0.975 0.98 CHJKQ test lenient parse currency match // This test is for #13112 diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/data/numberformattestspecification.txt b/icu4j/main/tests/core/src/com/ibm/icu/dev/data/numberformattestspecification.txt index 030f1259e8a..35775a5e0bd 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/data/numberformattestspecification.txt +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/data/numberformattestspecification.txt @@ -393,11 +393,11 @@ format maxIntegerDigits output breaks // C obeys maxIntegerDigits and prints after the decimal place 0 0 .0 HKQ // C and Q ignore max integer if it is less than zero and prints "123" -123 -2147483648 0 CQ +123 -2147483648 0 CJQ 12345 1 5 -12345 -2147483648 0 CQ +12345 -2147483648 0 CJQ 5.3 1 5.3 -5.3 -2147483648 .3 CQ +5.3 -2147483648 .3 CJQ test patterns with zero set locale en @@ -484,10 +484,10 @@ begin format multiplier output breaks 23 -12 -276 23 -1 -23 -// H (ICU4J 58) throws exception on zero multiplier. +// H (ICU4J 58) and J (current ICU4J) throw exception on zero multiplier. // ICU4C prints 23. // Q multiplies by zero and prints 0. -23 0 0 CH +23 0 0 CHJ 23 1 23 23 12 276 -23 12 -276 @@ -502,8 +502,8 @@ format output breaks -0.35 -0.25 K 0.35 0.25 K // Q doesn't support mixing minFrac with roundingIncrement (prints 0.50). -0.39 0.5 KQ -0.62 0.5 KQ +0.39 0.5 JKQ +0.62 0.5 JKQ 0.63 0.75 K test padding setters @@ -706,19 +706,19 @@ pattern toPattern breaks **0,000 **0,000 HK **##0,000 **##0,000 K **###0,000 **###0,000 K -**####0,000 **#,##0,000 CKS +**####0,000 **#,##0,000 CJKS ###,000. #,000. -0,000 #0,000 CS +0,000 #0,000 CJS .00 #.00 -000 #000 CS -000,000 #,000,000 CS +000 #000 CJS +000,000 #,000,000 CJS pp#,000 pp#,000 -00.## #00.## CS +00.## #00.## CJS #,#00.025 #,#00.025 // No secondary grouping in JDK #,##,###.02500 #,##,###.02500 K pp#,000;(#) pp#,000;(#,000) K -**####,##,##0.0##;(#) **#,##,##,##0.0##;**(##,##,##0.0##) CKS +**####,##,##0.0##;(#) **#,##,##,##0.0##;**(##,##,##0.0##) CJKS // No significant digits in JDK @@### @@### K @,@#,### @,@#,### K @@ -754,7 +754,7 @@ parse output breaks (34 25E-1) -342.5 K (34,,25E-1) -342.5 // H doesn't allow trailing separators before E but C and P do -(34,,25,E-1) -342.5 CHP +(34,,25,E-1) -342.5 CHJP (34 25 E-1) -342.5 HK (34,,25 E-1) -342.5 HK // Spaces are not allowed after exponent symbol @@ -817,7 +817,7 @@ parse output breaks 1,234,,,+ 1234 HK 1,234- -1234 // H, C, and P bail because of trailing separators -1,234,- -1234 CHP +1,234,- -1234 CHJP // J bails here too 1234 - -1234 H @@ -961,13 +961,10 @@ set negativePrefix set negativeSuffix 9N begin parse output breaks -// S is the only implementation that passes these cases. -// C and P consume the '9' as a digit and assumes number is negative -// H and JDK bail -6549K 654 CHKP -// C and P consume the '9' as a digit and assumes number is negative -// H and JDK bail -6549N -654 CHKP +// A non-greedy parse is required to pass these cases. +// All of the implementations being tested are greedy. +6549K 654 CHJKP +6549N -654 CHJKP test really strange prefix set locale en @@ -1033,7 +1030,7 @@ begin parse output outputCurrency breaks 53.45 fail GBP £53.45 53.45 GBP -$53.45 fail USD HP +$53.45 fail USD HJP 53.45 USD 53.45 USD 53.45 GBP 53.45 GBP USD 53.45 53.45 USD H @@ -1051,7 +1048,7 @@ USD(7.92) -7.92 USD H (8) USD -8 USD -8 USD -8 USD 67 USD 67 USD -53.45$ fail USD P +53.45$ fail USD JP US Dollars 53.45 53.45 USD H 53.45 US Dollars 53.45 USD US Dollar 53.45 53.45 USD H @@ -1080,7 +1077,7 @@ begin parse output outputCurrency breaks 53.45 fail GBP £53.45 53.45 GBP -$53.45 fail USD HP +$53.45 fail USD HJP 53.45 USD 53.45 USD 53.45 GBP 53.45 GBP USD 53.45 53.45 USD H @@ -1094,7 +1091,7 @@ USD -7.926 -7.926 USD H USD-7.92 -7.92 USD H -8 USD -8 USD 67 USD 67 USD -53.45$ fail USD P +53.45$ fail USD JP US Dollars 53.45 53.45 USD H 53.45 US Dollars 53.45 USD US Dollar 53.45 53.45 USD H @@ -1114,7 +1111,7 @@ parse output outputCurrency breaks // J throws a NullPointerException on the first case 53.45 fail GBP £53.45 53.45 GBP -$53.45 fail USD HP +$53.45 fail USD HJP 53.45 USD 53.45 USD 53.45 GBP 53.45 GBP USD 53.45 53.45 USD H @@ -1133,7 +1130,7 @@ USD(7.92) -7.92 USD H -8 USD -8 USD 67 USD 67 USD // J throws a NullPointerException on the next case -53.45$ fail USD P +53.45$ fail USD JP US Dollars 53.45 53.45 USD H 53.45 US Dollars 53.45 USD US Dollar 53.45 53.45 USD H @@ -1152,7 +1149,7 @@ begin parse output outputCurrency breaks 53.45 fail GBP £53.45 53.45 GBP -$53.45 fail USD HP +$53.45 fail USD HJP 53.45 USD 53.45 USD 53.45 GBP 53.45 GBP USD 53.45 53.45 USD H @@ -1170,7 +1167,7 @@ USD(7.92) -7.92 USD H (8) USD -8 USD -8 USD -8 USD 67 USD 67 USD -53.45$ fail USD P +53.45$ fail USD JP US Dollars 53.45 53.45 USD H 53.45 US Dollars 53.45 USD US Dollar 53.45 53.45 USD H @@ -1189,26 +1186,26 @@ begin parse output outputCurrency breaks 53.45 fail GBP £53.45 53.45 GBP -$53.45 fail USD HP +$53.45 fail USD HJP 53.45 USD 53.45 USD 53.45 GBP 53.45 GBP USD 53.45 53.45 USD H 53.45USD 53.45 USD H USD53.45 53.45 USD // C and P fail these because '(' is an incomplete prefix. -(7.92) USD -7.92 USD CHP -(7.92) GBP -7.92 GBP CHP -(7.926) USD -7.926 USD CHP -(7.926 USD) -7.926 USD CHP +(7.92) USD -7.92 USD CHJP +(7.92) GBP -7.92 GBP CHJP +(7.926) USD -7.926 USD CHJP +(7.926 USD) -7.926 USD CHJP (USD 7.926) -7.926 USD H -USD (7.926) -7.926 USD CHP -USD (7.92) -7.92 USD CHP -(7.92)USD -7.92 USD CHP -USD(7.92) -7.92 USD CHP -(8) USD -8 USD CHP +USD (7.926) -7.926 USD CHJP +USD (7.92) -7.92 USD CHJP +(7.92)USD -7.92 USD CHJP +USD(7.92) -7.92 USD CHJP +(8) USD -8 USD CHJP -8 USD -8 USD 67 USD 67 USD -53.45$ fail USD P +53.45$ fail USD JP US Dollars 53.45 53.45 USD H 53.45 US Dollars 53.45 USD US Dollar 53.45 53.45 USD H @@ -1235,10 +1232,10 @@ parse output outputCurrency breaks \u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR // P fails here because this currency name is in the Trie only, but it has the same prefix as the non-Trie currency -\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CP +\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP IRR 1235 1235 IRR \u0631\u06cc\u0627\u0644 1235 1235 IRR -\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CP +\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP test parse foreign currency ISO set pattern \u00a4\u00a4 0.00;\u00a4\u00a4 -# @@ -1247,10 +1244,10 @@ begin parse output outputCurrency breaks \u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR -\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CP +\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP IRR 1235 1235 IRR \u0631\u06cc\u0627\u0644 1235 1235 IRR -\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CP +\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP test parse foreign currency full set pattern \u00a4\u00a4\u00a4 0.00;\u00a4\u00a4\u00a4 -# @@ -1259,10 +1256,10 @@ begin parse output outputCurrency breaks \u0631\u06cc\u0627\u0644 \u06F1\u06F2\u06F3\u06F5 1235 IRR IRR \u06F1\u06F2\u06F3\u06F5 1235 IRR -\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CP +\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 \u06F1\u06F2\u06F3\u06F5 1235 IRR CJP IRR 1235 1235 IRR \u0631\u06cc\u0627\u0644 1235 1235 IRR -\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CP +\u0631\u06cc\u0627\u0644 \u0627\u06cc\u0631\u0627\u0646 1235 1235 IRR CJP test parse currency with foreign symbols symbol english set pattern \u00a4 0.00;\u00a4 (#) @@ -1304,10 +1301,10 @@ begin parse currency output breaks $52.41 USD 52.41 USD52.41 USD 52.41 K -\u20ac52.41 USD fail CP -EUR52.41 USD fail CP -$52.41 EUR fail CP -USD52.41 EUR fail CP +\u20ac52.41 USD fail CJP +EUR52.41 USD fail CJP +$52.41 EUR fail CJP +USD52.41 EUR fail CJP \u20ac52.41 EUR 52.41 K EUR52.41 EUR 52.41 @@ -1317,11 +1314,11 @@ set locale en_US set lenient 0 begin parse output outputCurrency breaks -$53.45 53.45 USD CP +$53.45 53.45 USD CJP 53.45 USD 53.45 USD USD 53.45 fail USD 53.45USD fail USD -USD53.45 53.45 USD CP +USD53.45 53.45 USD CJP (7.92) USD -7.92 USD (7.92) EUR -7.92 EUR (7.926) USD -7.926 USD @@ -1339,9 +1336,9 @@ US Dollars 53.45 fail USD 53.45 US Dollars 53.45 USD US Dollar 53.45 fail USD 53.45 US Dollar 53.45 USD -US Dollars53.45 53.45 USD CP +US Dollars53.45 53.45 USD CJP 53.45US Dollars fail USD -US Dollar53.45 53.45 USD CP +US Dollar53.45 53.45 USD CJP US Dollat53.45 fail USD 53.45US Dollar fail USD US Dollars (53.45) fail USD @@ -1433,13 +1430,13 @@ NaN NaN K -1E-99999999999999 -0.0 1E2147483648 Inf K 1E2147483647 Inf K -// H and K get Infinity -1E2147483646 1E+2147483646 HK +// H, J and K get Infinity +1E2147483646 1E+2147483646 HJK 1E-2147483649 0 1E-2147483648 0 // H, K, C and P return zero here -1E-2147483647 1E-2147483647 CHKP -1E-2147483646 1E-2147483646 HK +1E-2147483647 1E-2147483647 CHJKP +1E-2147483646 1E-2147483646 HJK test format push limits set locale en @@ -1511,7 +1508,7 @@ y g h56 -56 HK 56i j‎k -56 HK 56‎i jk -56 HK // S and C get 56 (accepts ' ' gs grouping); H and K get null -5 6 fail CP +5 6 fail CJP 5‎6 5 HK test parse spaces in grouping @@ -1522,8 +1519,8 @@ set pattern #,##0 begin parse output breaks // C, H, S, and P get "12" here -1 2 1 CHP -1 23 1 CHP +1 2 1 CHJP +1 23 1 CHJP // K gets 1 here; doesn't pick up the grouping separator 1 234 1234 K @@ -1538,7 +1535,7 @@ format output breaks // C and J get "1" // Q gets "1.0" // K gets "1.1" (??) -0.975 0.98 CHKQ +0.975 0.98 CHJKQ test lenient parse currency match // This test is for #13112 diff --git a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatDataDrivenTest.java b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatDataDrivenTest.java index 8c189f8bfaf..00b250251aa 100644 --- a/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatDataDrivenTest.java +++ b/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/NumberFormatDataDrivenTest.java @@ -172,7 +172,6 @@ public class NumberFormatDataDrivenTest { * @return */ private DecimalFormat createDecimalFormat(DataDrivenNumberFormatTestData tuple) { - DecimalFormat fmt = new DecimalFormat(tuple.pattern == null ? "0" : tuple.pattern, new DecimalFormatSymbols(tuple.locale == null ? EN : tuple.locale)); adjustDecimalFormat(tuple, fmt); @@ -200,7 +199,7 @@ public class NumberFormatDataDrivenTest { fmt.setCurrency(tuple.currency); } if (tuple.minGroupingDigits != null) { - // Oops we don't support this. + fmt.setMinimumGroupingDigits(tuple.minGroupingDigits); } if (tuple.useSigDigits != null) { fmt.setSignificantDigitsUsed(tuple.useSigDigits != 0); @@ -266,7 +265,7 @@ public class NumberFormatDataDrivenTest { fmt.setNegativeSuffix(tuple.negativeSuffix); } if (tuple.signAlwaysShown != null) { - // Not supported. + fmt.setSignAlwaysShown(tuple.signAlwaysShown != 0); } if (tuple.localizedPattern != null) { fmt.applyLocalizedPattern(tuple.localizedPattern); @@ -277,13 +276,13 @@ public class NumberFormatDataDrivenTest { fmt.setParseIntegerOnly(tuple.parseIntegerOnly != 0); } if (tuple.parseCaseSensitive != null) { - // Not supported. + fmt.setParseCaseSensitive(tuple.parseCaseSensitive != 0); } if (tuple.decimalPatternMatchRequired != null) { fmt.setDecimalPatternMatchRequired(tuple.decimalPatternMatchRequired != 0); } if (tuple.parseNoExponent != null) { - // Oops, not supported for now + fmt.setParseNoExponent(tuple.parseNoExponent != 0); } } }; @@ -907,11 +906,11 @@ public class NumberFormatDataDrivenTest { } }; - // @Test - // public void TestDataDrivenICU4J() { - // DataDrivenNumberFormatTestUtility - // .runFormatSuiteIncludingKnownFailures("numberformattestspecification.txt", ICU4J); - // } + @Test + public void TestDataDrivenICU4J() { + DataDrivenNumberFormatTestUtility + .runFormatSuiteIncludingKnownFailures("numberformattestspecification.txt", ICU4J); + } @Test public void TestDataDrivenICU58() {