summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/Intl/unicode-bcp47-locale-ids-variants-legacy-mappings.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/non262/Intl/unicode-bcp47-locale-ids-variants-legacy-mappings.js')
-rw-r--r--js/src/tests/non262/Intl/unicode-bcp47-locale-ids-variants-legacy-mappings.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/js/src/tests/non262/Intl/unicode-bcp47-locale-ids-variants-legacy-mappings.js b/js/src/tests/non262/Intl/unicode-bcp47-locale-ids-variants-legacy-mappings.js
new file mode 100644
index 0000000000..49e31c6786
--- /dev/null
+++ b/js/src/tests/non262/Intl/unicode-bcp47-locale-ids-variants-legacy-mappings.js
@@ -0,0 +1,15 @@
+// |reftest| skip-if(!this.hasOwnProperty("Intl"))
+
+// ECMA-402 includes mapping of legacy variants, as long as they're also present
+// in <variantAlias> in CLDR's supplementalMetadata.xml
+// <https://www.unicode.org/reports/tr35/#Legacy_Variants>
+
+assertEq(Intl.getCanonicalLocales("sv-AALAND")[0], "sv-AX");
+assertEq(Intl.getCanonicalLocales("no-BOKMAL")[0], "nb-bokmal");
+assertEq(Intl.getCanonicalLocales("no-NYNORSK")[0], "nb-nynorsk");
+assertEq(Intl.getCanonicalLocales("en-POSIX")[0], "en-posix");
+assertEq(Intl.getCanonicalLocales("el-POLYTONI")[0], "el-polyton");
+assertEq(Intl.getCanonicalLocales("aa-SAAHO")[0], "aa-saaho");
+
+if (typeof reportCompare === "function")
+ reportCompare(true, true);