summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/intl402/NumberFormat/casing-numbering-system-options.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/intl402/NumberFormat/casing-numbering-system-options.js')
-rw-r--r--js/src/tests/test262/intl402/NumberFormat/casing-numbering-system-options.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/js/src/tests/test262/intl402/NumberFormat/casing-numbering-system-options.js b/js/src/tests/test262/intl402/NumberFormat/casing-numbering-system-options.js
new file mode 100644
index 0000000000..a4960f9cc2
--- /dev/null
+++ b/js/src/tests/test262/intl402/NumberFormat/casing-numbering-system-options.js
@@ -0,0 +1,28 @@
+// Copyright 2020 Google Inc, Igalia S.L. All rights reserved.
+// This code is governed by the BSD license found in the LICENSE file.
+
+/*---
+esid: sec-initializenumberformat
+description: >
+ Tests that the options numberingSystem are mapped to lower case.
+author: Caio Lima
+---*/
+
+let defaultLocale = new Intl.NumberFormat().resolvedOptions().locale;
+
+let supportedNumberingSystems = ["latn", "arab"].filter(nu =>
+ new Intl.NumberFormat(defaultLocale + "-u-nu-" + nu)
+ .resolvedOptions().numberingSystem === nu
+);
+
+if (supportedNumberingSystems.includes("latn")) {
+ let numberFormat = new Intl.NumberFormat(defaultLocale + "-u-nu-lATn");
+ assert.sameValue(numberFormat.resolvedOptions().numberingSystem, "latn", "Numbering system option should be in lower case");
+}
+
+if (supportedNumberingSystems.includes("arab")) {
+ let numberFormat = new Intl.NumberFormat(defaultLocale + "-u-nu-Arab");
+ assert.sameValue(numberFormat.resolvedOptions().numberingSystem, "arab", "Numbering system option should be in lower case");
+}
+
+reportCompare(0, 0);