]> granicus.if.org Git - icu/commitdiff
ICU-11319 Add tests for compact decimal in zh-Hant and zh-Hant-HK. (#166)
authorShane F. Carr <shane@unicode.org>
Sat, 22 Sep 2018 01:18:48 +0000 (18:18 -0700)
committerShane Carr <shane@unicode.org>
Thu, 27 Sep 2018 21:27:41 +0000 (14:27 -0700)
icu4c/source/test/intltest/numbertest_api.cpp
icu4j/main/tests/core/src/com/ibm/icu/dev/test/number/NumberFormatterApiTest.java

index ec8da929244fe5380de9688e132f6b3d191e457a..78a8d27282de81ee4b6fdf189975b914936b0aee 100644 (file)
@@ -403,6 +403,22 @@ void NumberFormatterApiTest::notationCompact() {
             9990000,
             u"10M");
 
+    assertFormatSingle(
+            u"Compact in zh-Hant-HK",
+            u"compact-short",
+            NumberFormatter::with().notation(Notation::compactShort()),
+            Locale("zh-Hant-HK"),
+            1e7,
+            u"10M");
+
+    assertFormatSingle(
+            u"Compact in zh-Hant",
+            u"compact-short",
+            NumberFormatter::with().notation(Notation::compactShort()),
+            Locale("zh-Hant"),
+            1e7,
+            u"1000\u842C");
+
     // NOTE: There is no API for compact custom data in C++
     // and thus no "Compact Somali No Figure" test
 }
index 761b4e11eef98fb611b33f978cc1c45159ab55e9..90e0fc28df30ef5a7b5c1527ecb0e2f7327a2c26 100644 (file)
@@ -369,6 +369,22 @@ public class NumberFormatterApiTest {
                 9990000,
                 "10M");
 
+        assertFormatSingle(
+                "Compact in zh-Hant-HK",
+                "compact-short",
+                NumberFormatter.with().notation(Notation.compactShort()),
+                new ULocale("zh-Hant-HK"),
+                1e7,
+                "10M");
+
+        assertFormatSingle(
+                "Compact in zh-Hant",
+                "compact-short",
+                NumberFormatter.with().notation(Notation.compactShort()),
+                new ULocale("zh-Hant"),
+                1e7,
+                "1000\u842C");
+
         Map<String, Map<String, String>> compactCustomData = new HashMap<String, Map<String, String>>();
         Map<String, String> entry = new HashMap<String, String>();
         entry.put("one", "Kun");