summaryrefslogtreecommitdiff
path: root/deps/v8/test/intl
diff options
context:
space:
mode:
authorMichaël Zasso <targos@protonmail.com>2021-10-10 11:10:43 +0200
committerMichaël Zasso <targos@protonmail.com>2021-10-12 08:07:50 +0200
commit62719c5fd2ab7dee1ac4019c1715061d556ac457 (patch)
tree356fed3842e577ab58fd51d5cc02f071cf7ee216 /deps/v8/test/intl
parenta784258444b052dfd31cca90db57b21dc38bb1eb (diff)
downloadnode-new-62719c5fd2ab7dee1ac4019c1715061d556ac457.tar.gz
deps: update V8 to 9.5.172.19
PR-URL: https://github.com/nodejs/node/pull/40178 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/test/intl')
-rw-r--r--deps/v8/test/intl/enumeration/calendar-sorted.js11
-rw-r--r--deps/v8/test/intl/enumeration/callendar-syntax-valid.js14
-rw-r--r--deps/v8/test/intl/enumeration/collation-sorted.js11
-rw-r--r--deps/v8/test/intl/enumeration/collation-syntax-valid.js14
-rw-r--r--deps/v8/test/intl/enumeration/currency-sorted.js11
-rw-r--r--deps/v8/test/intl/enumeration/currency-syntax-valid.js14
-rw-r--r--deps/v8/test/intl/enumeration/numberingSystem-no-algorithm.js20
-rw-r--r--deps/v8/test/intl/enumeration/numberingSystem-sorted.js11
-rw-r--r--deps/v8/test/intl/enumeration/numberingSystem-syntax-valid.js14
-rw-r--r--deps/v8/test/intl/enumeration/supported-values-of-invalid-key.js12
-rw-r--r--deps/v8/test/intl/enumeration/supported-values-of-name.js7
-rw-r--r--deps/v8/test/intl/enumeration/supported-values-of-property.js11
-rw-r--r--deps/v8/test/intl/enumeration/supported-values-of-valid-key.js12
-rw-r--r--deps/v8/test/intl/enumeration/timeZone-sorted.js11
-rw-r--r--deps/v8/test/intl/enumeration/unit-sorted.js11
-rw-r--r--deps/v8/test/intl/locale/locale-calendars.js2
-rw-r--r--deps/v8/test/intl/regress-7770.js2
17 files changed, 186 insertions, 2 deletions
diff --git a/deps/v8/test/intl/enumeration/calendar-sorted.js b/deps/v8/test/intl/enumeration/calendar-sorted.js
new file mode 100644
index 0000000000..11e19c06f8
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/calendar-sorted.js
@@ -0,0 +1,11 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+// Test the return items of calendar is sorted
+let name = "calendar";
+let items = Intl.supportedValuesOf(name);
+assertEquals([...items].sort(), items,
+ "return value of Intl.supportedValuesOf('" + name + "') should be sorted");
diff --git a/deps/v8/test/intl/enumeration/callendar-syntax-valid.js b/deps/v8/test/intl/enumeration/callendar-syntax-valid.js
new file mode 100644
index 0000000000..881c7e603c
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/callendar-syntax-valid.js
@@ -0,0 +1,14 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+// Test the return items of calendar fit 'type'
+let regex = /^[a-zA-Z0-9]{3,8}(-[a-zA-Z0-9]{3,8})*$/;
+Intl.supportedValuesOf("calendar").forEach(
+ function(calendar) {
+ assertTrue(regex.test(calendar),
+ "Intl.supportedValuesOf('calendar') return " + calendar +
+ " which does not meet 'type: alphanum{3,8}(sep alphanum{3,8})*'");
+ });
diff --git a/deps/v8/test/intl/enumeration/collation-sorted.js b/deps/v8/test/intl/enumeration/collation-sorted.js
new file mode 100644
index 0000000000..d40e9be3bb
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/collation-sorted.js
@@ -0,0 +1,11 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+// Test the return items of collation is sorted
+let name = "collation";
+let items = Intl.supportedValuesOf(name);
+assertEquals([...items].sort(), items,
+ "return value of Intl.supportedValuesOf('" + name + "') should be sorted");
diff --git a/deps/v8/test/intl/enumeration/collation-syntax-valid.js b/deps/v8/test/intl/enumeration/collation-syntax-valid.js
new file mode 100644
index 0000000000..e68d565fa8
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/collation-syntax-valid.js
@@ -0,0 +1,14 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+// Test the return items of collation fit 'type'
+let regex = /^[a-zA-Z0-9]{3,8}(-[a-zA-Z0-9]{3,8})*$/;
+Intl.supportedValuesOf("collation").forEach(
+ function(collation) {
+ assertTrue(regex.test(collation),
+ "Intl.supportedValuesOf('collation') return " + collation +
+ " which does not meet 'type: alphanum{3,8}(sep alphanum{3,8})*'");
+ });
diff --git a/deps/v8/test/intl/enumeration/currency-sorted.js b/deps/v8/test/intl/enumeration/currency-sorted.js
new file mode 100644
index 0000000000..55ff1bc611
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/currency-sorted.js
@@ -0,0 +1,11 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+// Test the return items of currency is sorted
+let name = "currency";
+let items = Intl.supportedValuesOf(name);
+assertEquals([...items].sort(), items,
+ "return value of Intl.supportedValuesOf('" + name + "') should be sorted");
diff --git a/deps/v8/test/intl/enumeration/currency-syntax-valid.js b/deps/v8/test/intl/enumeration/currency-syntax-valid.js
new file mode 100644
index 0000000000..cce3c612bd
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/currency-syntax-valid.js
@@ -0,0 +1,14 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+// Test the return items of currency fit 'type'
+let regex = /^[A-Z]{3}$/;
+Intl.supportedValuesOf("currency").forEach(
+ function(currency) {
+ assertTrue(regex.test(currency),
+ "Intl.supportedValuesOf('currency') return " + currency +
+ " which does not meet 'alpha{3}'");
+ });
diff --git a/deps/v8/test/intl/enumeration/numberingSystem-no-algorithm.js b/deps/v8/test/intl/enumeration/numberingSystem-no-algorithm.js
new file mode 100644
index 0000000000..bf8c1a11eb
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/numberingSystem-no-algorithm.js
@@ -0,0 +1,20 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+// Chrome filter out data of algorithm numberingSystems so we need to test none
+// of them got returned.
+let name = "numberingSystem";
+let items = Intl.supportedValuesOf(name);
+
+function verifyNoAlgorithm(nu) {
+ assertTrue(items.indexOf(nu) < 0, "should not return '" + nu + "' which is algorithmic");
+}
+
+["armn", "armnlow", "cyrl", "ethi", "finance", "geor", "grek", "greklow",
+ "hans", "hansfin", "hant", "hantfin", "hebr", "japn", "japnfin",
+ "roman", "romanlow", "taml", "traditio"].forEach(function(nu) {
+ verifyNoAlgorithm(nu);
+});
diff --git a/deps/v8/test/intl/enumeration/numberingSystem-sorted.js b/deps/v8/test/intl/enumeration/numberingSystem-sorted.js
new file mode 100644
index 0000000000..7cd0d85052
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/numberingSystem-sorted.js
@@ -0,0 +1,11 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+// Test the return items of numberingSystem is sorted
+let name = "numberingSystem";
+let items = Intl.supportedValuesOf(name);
+assertEquals([...items].sort(), items,
+ "return value of Intl.supportedValuesOf('" + name + "') should be sorted");
diff --git a/deps/v8/test/intl/enumeration/numberingSystem-syntax-valid.js b/deps/v8/test/intl/enumeration/numberingSystem-syntax-valid.js
new file mode 100644
index 0000000000..d80976d519
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/numberingSystem-syntax-valid.js
@@ -0,0 +1,14 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+// Test the return items of numberingSystem fit 'type'
+let regex = /^[a-zA-Z0-9]{3,8}(-[a-zA-Z0-9]{3,8})*$/;
+Intl.supportedValuesOf("numberingSystem").forEach(
+ function(numberingSystem) {
+ assertTrue(regex.test(numberingSystem),
+ "Intl.supportedValuesOf('numberingSystem') return " + numberingSystem +
+ " which does not meet 'type: alphanum{3,8}(sep alphanum{3,8})*'");
+ });
diff --git a/deps/v8/test/intl/enumeration/supported-values-of-invalid-key.js b/deps/v8/test/intl/enumeration/supported-values-of-invalid-key.js
new file mode 100644
index 0000000000..27651df74c
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/supported-values-of-invalid-key.js
@@ -0,0 +1,12 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+// Test invalid keys
+["calendars", "collations", "currencies", "numberingSystems", "timeZones", "units",
+ 1, 0.3, true, false, {}, [] ].forEach(
+ function(key) {
+ assertThrows(() => Intl.supportedValuesOf(key), RangeError);
+ });
diff --git a/deps/v8/test/intl/enumeration/supported-values-of-name.js b/deps/v8/test/intl/enumeration/supported-values-of-name.js
new file mode 100644
index 0000000000..a0cbfd5333
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/supported-values-of-name.js
@@ -0,0 +1,7 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+assertEquals("supportedValuesOf", Intl.supportedValuesOf.name);
diff --git a/deps/v8/test/intl/enumeration/supported-values-of-property.js b/deps/v8/test/intl/enumeration/supported-values-of-property.js
new file mode 100644
index 0000000000..52b0778b54
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/supported-values-of-property.js
@@ -0,0 +1,11 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+let descriptor = Object.getOwnPropertyDescriptor(
+ Intl, "supportedValuesOf");
+assertTrue(descriptor.writable);
+assertFalse(descriptor.enumerable);
+assertTrue(descriptor.configurable);
diff --git a/deps/v8/test/intl/enumeration/supported-values-of-valid-key.js b/deps/v8/test/intl/enumeration/supported-values-of-valid-key.js
new file mode 100644
index 0000000000..ac5b4d8e5d
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/supported-values-of-valid-key.js
@@ -0,0 +1,12 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+// Test valid keys
+["calendar", "collation", "currency", "numberingSystem", "timeZone", "unit"].forEach(
+ function(key) {
+ assertDoesNotThrow(() => Intl.supportedValuesOf(key));
+ assertEquals("object", typeof Intl.supportedValuesOf(key));
+ });
diff --git a/deps/v8/test/intl/enumeration/timeZone-sorted.js b/deps/v8/test/intl/enumeration/timeZone-sorted.js
new file mode 100644
index 0000000000..e3b5b484e2
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/timeZone-sorted.js
@@ -0,0 +1,11 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+// Test the return items of timeZone is sorted
+let name = "timeZone";
+let items = Intl.supportedValuesOf(name);
+assertEquals([...items].sort(), items,
+ "return value of Intl.supportedValuesOf('" + name + "') should be sorted");
diff --git a/deps/v8/test/intl/enumeration/unit-sorted.js b/deps/v8/test/intl/enumeration/unit-sorted.js
new file mode 100644
index 0000000000..08dd1d93e8
--- /dev/null
+++ b/deps/v8/test/intl/enumeration/unit-sorted.js
@@ -0,0 +1,11 @@
+// Copyright 2021 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Flags: --harmony_intl_enumeration
+
+// Test the return items of unit is sorted
+let name = "unit";
+let items = Intl.supportedValuesOf(name);
+assertEquals([...items].sort(), items,
+ "return value of Intl.supportedValuesOf('" + name + "') should be sorted");
diff --git a/deps/v8/test/intl/locale/locale-calendars.js b/deps/v8/test/intl/locale/locale-calendars.js
index f5a10c6dc3..620440b01e 100644
--- a/deps/v8/test/intl/locale/locale-calendars.js
+++ b/deps/v8/test/intl/locale/locale-calendars.js
@@ -14,7 +14,7 @@ for (var i = 0; i < a_to_z.length; i++) {
locale.calendars.forEach(function(tokens) {
assertTrue(regex.test(tokens),
locale + ".calendars [" + locale.calendars +
- "] does not meet 'type: alphanum{3,8}(sep alphanum{3,8})*'");
+ "] but '" + tokens + "' does not meet 'type: alphanum{3,8}(sep alphanum{3,8})*'");
});
}
}
diff --git a/deps/v8/test/intl/regress-7770.js b/deps/v8/test/intl/regress-7770.js
index 2e7c2ce22d..0d2ddf13ca 100644
--- a/deps/v8/test/intl/regress-7770.js
+++ b/deps/v8/test/intl/regress-7770.js
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-// Environment Variables: TZ=Indian/Kerguelen LANG=uk
+// Environment Variables: TZ=Indian/Kerguelen LANG=uk LC_MESSAGES=uk
assertEquals(
"Fri Feb 01 2019 00:00:00 GMT+0500 (за часом на Французьких Південних і Антарктичних територіях)",
new Date(2019, 1,1).toString());