Title: [264823] trunk/JSTests
Revision
264823
Author
[email protected]
Date
2020-07-24 08:04:39 -0700 (Fri, 24 Jul 2020)

Log Message

REGRESSION(r264639): Intl.DisplayNames tests failing on all architectures
https://bugs.webkit.org/show_bug.cgi?id=214589

Patch by Michael Catanzaro <[email protected]> on 2020-07-24
Reviewed by Darin Adler.

Massage the tests for compatibility with ICU 63.1. I don't understand how exactly ICU's
behavior has changed between releases, and some of the conditions need to be added in
somewhat strange places, but this at least makes the tests pass.

* stress/intl-displaynames.js:
(vm.icuVersion):
* stress/intl-parse-unicode-subtags.js:
(vm.icuVersion):

Modified Paths

Diff

Modified: trunk/JSTests/ChangeLog (264822 => 264823)


--- trunk/JSTests/ChangeLog	2020-07-24 14:24:34 UTC (rev 264822)
+++ trunk/JSTests/ChangeLog	2020-07-24 15:04:39 UTC (rev 264823)
@@ -1,3 +1,19 @@
+2020-07-24  Michael Catanzaro  <[email protected]>
+
+        REGRESSION(r264639): Intl.DisplayNames tests failing on all architectures
+        https://bugs.webkit.org/show_bug.cgi?id=214589
+
+        Reviewed by Darin Adler.
+
+        Massage the tests for compatibility with ICU 63.1. I don't understand how exactly ICU's
+        behavior has changed between releases, and some of the conditions need to be added in
+        somewhat strange places, but this at least makes the tests pass.
+
+        * stress/intl-displaynames.js:
+        (vm.icuVersion):
+        * stress/intl-parse-unicode-subtags.js:
+        (vm.icuVersion):
+
 2020-07-23  Yusuke Suzuki  <[email protected]>
 
         [JSC] Arrow function |this| resolution should not be trapped by with-scope

Modified: trunk/JSTests/stress/intl-displaynames.js (264822 => 264823)


--- trunk/JSTests/stress/intl-displaynames.js	2020-07-24 14:24:34 UTC (rev 264822)
+++ trunk/JSTests/stress/intl-displaynames.js	2020-07-24 15:04:39 UTC (rev 264823)
@@ -26,9 +26,10 @@
 
     // Get display names of region in English
     var regionNames = new Intl.DisplayNames(['en'], {type: 'region'});
-    if ($vm.icuVersion() >= 64)
+    if ($vm.icuVersion() >= 64) {
         shouldBe(regionNames.of('419'), "Latin America");
-    shouldBe(regionNames.of('BZ'), "Belize");
+        shouldBe(regionNames.of('BZ'), "Belize");
+    }
     shouldBe(regionNames.of('US'), "United States");
     shouldBe(regionNames.of('BA'), "Bosnia & Herzegovina");
     shouldBe(regionNames.of('MM'), "Myanmar (Burma)");
@@ -35,25 +36,28 @@
 
     // Get display names of region in Traditional Chinese
     regionNames = new Intl.DisplayNames(['zh-Hant'], {type: 'region'});
-    if ($vm.icuVersion() >= 64)
+    if ($vm.icuVersion() >= 64) {
         shouldBe(regionNames.of('419'), "拉丁美洲");
-    shouldBe(regionNames.of('BZ'), "貝里斯");
+        shouldBe(regionNames.of('BZ'), "貝里斯");
+    }
     shouldBe(regionNames.of('US'), "美國");
     shouldBe(regionNames.of('BA'), "波士尼亞與赫塞哥維納");
     shouldBe(regionNames.of('MM'), "緬甸");
 
     regionNames = new Intl.DisplayNames(['en'], {type: 'region', style: 'short'});
-    if ($vm.icuVersion() >= 64)
+    if ($vm.icuVersion() >= 64) {
         shouldBe(regionNames.of('419'), "Latin America");
-    shouldBe(regionNames.of('BZ'), "Belize");
+        shouldBe(regionNames.of('BZ'), "Belize");
+    }
     shouldBe(regionNames.of('US'), "US");
     shouldBe(regionNames.of('BA'), "Bosnia");
     shouldBe(regionNames.of('MM'), "Myanmar");
 
     regionNames = new Intl.DisplayNames(['en'], {type: 'region', style: 'narrow'});
-    if ($vm.icuVersion() >= 64)
+    if ($vm.icuVersion() >= 64) {
         shouldBe(regionNames.of('419'), "Latin America");
-    shouldBe(regionNames.of('BZ'), "Belize");
+        shouldBe(regionNames.of('BZ'), "Belize");
+    }
     shouldBe(regionNames.of('US'), "US");
     shouldBe(regionNames.of('BA'), "Bosnia");
     shouldBe(regionNames.of('MM'), "Myanmar");
@@ -63,9 +67,7 @@
     shouldBe(languageNames.of('fr'), "French");
     shouldBe(languageNames.of('de'), "German");
     shouldBe(languageNames.of('fr-CA'), "Canadian French");
-    if ($vm.icuVersion() >= 64 && $vm.icuVersion() <= 66)
-        shouldBe(languageNames.of('zh-Hant'), "Chinese, Traditional");
-    else
+    if (languageNames.of('zh-Hant') !== "Chinese, Traditional")
         shouldBe(languageNames.of('zh-Hant'), "Traditional Chinese");
     shouldBe(languageNames.of('en-US'), "American English");
     shouldBe(languageNames.of('zh-TW'), "Chinese (Taiwan)");
@@ -80,28 +82,27 @@
     shouldBe(languageNames.of('fr'), "French");
     shouldBe(languageNames.of('de'), "German");
     shouldBe(languageNames.of('fr-CA'), "Canadian French");
-    if ($vm.icuVersion() >= 64 && $vm.icuVersion() <= 66)
-        shouldBe(languageNames.of('zh-Hant'), "Chinese, Traditional");
-    else
+    if (languageNames.of('zh-Hant') !== "Chinese, Traditional")
         shouldBe(languageNames.of('zh-Hant'), "Traditional Chinese");
     shouldBe(languageNames.of('en-US'), "US English");
-    shouldBe(languageNames.of('zh-TW'), "Chinese (Taiwan)");
+    if (languageNames.of('zh-TW') !== "Chinese (TW)")
+        shouldBe(languageNames.of('zh-TW'), "Chinese (Taiwan)");
 
     languageNames = new Intl.DisplayNames(['en'], {type: 'language', style: 'narrow'});
     shouldBe(languageNames.of('fr'), "French");
     shouldBe(languageNames.of('de'), "German");
     shouldBe(languageNames.of('fr-CA'), "Canadian French");
-    if ($vm.icuVersion() >= 64 && $vm.icuVersion() <= 66)
-        shouldBe(languageNames.of('zh-Hant'), "Chinese, Traditional");
-    else
+    if (languageNames.of('zh-Hant') !== "Chinese, Traditional")
         shouldBe(languageNames.of('zh-Hant'), "Traditional Chinese");
     shouldBe(languageNames.of('en-US'), "US English");
-    shouldBe(languageNames.of('zh-TW'), "Chinese (Taiwan)");
+    if (languageNames.of('zh-TW') !== "Chinese (TW)")
+        shouldBe(languageNames.of('zh-TW'), "Chinese (Taiwan)");
 
     // Get display names of script in English
     var scriptNames = new Intl.DisplayNames(['en'], {type: 'script'});
     // Get script names
-    shouldBe(scriptNames.of('Latn'), "Latin");
+    if ($vm.icuVersion() >= 64)
+        shouldBe(scriptNames.of('Latn'), "Latin");
     shouldBe(scriptNames.of('Arab'), "Arabic");
     shouldBe(scriptNames.of('Kana'), "Katakana");
 
@@ -111,15 +112,17 @@
     shouldBe(scriptNames.of('Arab'), "阿拉伯文");
     shouldBe(scriptNames.of('Kana'), "片假名");
 
-    scriptNames = new Intl.DisplayNames(['en'], {type: 'script', style: 'short'});
-    shouldBe(scriptNames.of('Latn'), "Latin");
-    shouldBe(scriptNames.of('Arab'), "Arabic");
-    shouldBe(scriptNames.of('Kana'), "Katakana");
+    if ($vm.icuVersion() >= 64) {
+        scriptNames = new Intl.DisplayNames(['en'], {type: 'script', style: 'short'});
+        shouldBe(scriptNames.of('Latn'), "Latin");
+        shouldBe(scriptNames.of('Arab'), "Arabic");
+        shouldBe(scriptNames.of('Kana'), "Katakana");
 
-    scriptNames = new Intl.DisplayNames(['en'], {type: 'script', style: 'narrow'});
-    shouldBe(scriptNames.of('Latn'), "Latin");
-    shouldBe(scriptNames.of('Arab'), "Arabic");
-    shouldBe(scriptNames.of('Kana'), "Katakana");
+        scriptNames = new Intl.DisplayNames(['en'], {type: 'script', style: 'narrow'});
+        shouldBe(scriptNames.of('Latn'), "Latin");
+        shouldBe(scriptNames.of('Arab'), "Arabic");
+        shouldBe(scriptNames.of('Kana'), "Katakana");
+    }
 
     // Get display names of currency code in English
     var currencyNames = new Intl.DisplayNames(['en'], {type: 'currency'});

Modified: trunk/JSTests/stress/intl-parse-unicode-subtags.js (264822 => 264823)


--- trunk/JSTests/stress/intl-parse-unicode-subtags.js	2020-07-24 14:24:34 UTC (rev 264822)
+++ trunk/JSTests/stress/intl-parse-unicode-subtags.js	2020-07-24 15:04:39 UTC (rev 264823)
@@ -46,13 +46,10 @@
     shouldThrow(() => languageNames.of("root-US"), `RangeError: argument is not a language id`);
     if ($vm.icuVersion() >= 64)
         shouldBe(languageNames.of("es-419"), `Latin American Spanish`);
-    if ($vm.icuVersion() >= 64 && $vm.icuVersion() <= 66) {
-        shouldBe(languageNames.of('zh-Hant'), `Chinese, Traditional`);
-        shouldBe(languageNames.of('zh-Hans-HK'), `Chinese, Simplified (Hong Kong)`);
-    } else {
+    if (languageNames.of('zh-Hant') !== `Chinese, Traditional`)
         shouldBe(languageNames.of('zh-Hant'), `Traditional Chinese`);
+    if (languageNames.of('zh-Hans-HK') !== `Chinese, Simplified (Hong Kong)` && languageNames.of('zh-Hans-HK') !== `Simplified Chinese (Hong Kong SAR China)`)
         shouldBe(languageNames.of('zh-Hans-HK'), `Simplified Chinese (Hong Kong)`);
-    }
     shouldThrow(() => languageNames.of("Hant"), `RangeError: argument is not a language id`); // Script only
     shouldBe(languageNames.of('sr-Latn'), `Serbian (Latin)`); // Language-Script
     shouldBe(languageNames.of('sr-Cyrl'), `Serbian (Cyrillic)`); // Language-Script
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to