summaryrefslogtreecommitdiff
path: root/deps/v8/test/intl/locale/locale-info-ext.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/intl/locale/locale-info-ext.js')
-rw-r--r--deps/v8/test/intl/locale/locale-info-ext.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/deps/v8/test/intl/locale/locale-info-ext.js b/deps/v8/test/intl/locale/locale-info-ext.js
new file mode 100644
index 0000000000..647e6c8a4e
--- /dev/null
+++ b/deps/v8/test/intl/locale/locale-info-ext.js
@@ -0,0 +1,26 @@
+// 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_locale_info
+
+// Test Unicode extension.
+function testExt(base, ukey, uvalue, property) {
+ let baseLocale = new Intl.Locale(base);
+ let extLocale = new Intl.Locale(base + "-u-" + ukey + "-" + uvalue);
+
+ let baseActual = baseLocale[property];
+ assertTrue(Array.isArray(baseActual));
+ assertTrue(baseActual.length > 0);
+ assertFalse(uvalue == baseActual[0]);
+
+ let extActual = extLocale[property];
+ assertTrue(Array.isArray(extActual));
+ assertEquals(1, extActual.length);
+ assertEquals(uvalue, extActual[0]);
+}
+
+testExt("ar", "ca", "roc", "calendars");
+testExt("fr", "nu", "thai", "numberingSystems");
+testExt("th", "co", "pinyin", "collations");
+testExt("ko", "hc", "h11", "hourCycles");