Debian Codegraph @

js/src/tests/test262/intl402/Segmenter/constructor/supportedLocalesOf/locales-specific.js

raw
1 // |reftest| skip-if(!Intl.Segmenter) -- Intl.Segmenter is not enabled unconditionally
2 // Copyright 2018 the V8 project authors, Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 esid: sec-Intl.Segmenter.supportedLocalesOf
7 description: Checks handling of specific locales arguments to the supportedLocalesOf function.
8 info: |
9 Intl.Segmenter.supportedLocalesOf ( locales [, options ])
10
11 3. Return ? SupportedLocales(availableLocales, requestedLocales, options).
12 includes: [compareArray.js]
13 locale: [sr, sr-Thai-RS, de, zh-CN]
14 features: [Intl.Segmenter]
15 ---*/
16
17 assert.sameValue(typeof Intl.Segmenter.supportedLocalesOf, "function",
18 "Should support Intl.Segmenter.supportedLocalesOf.");
19
20 assert.compareArray(Intl.Segmenter.supportedLocalesOf("sr"), ["sr"]);
21
22 const multiLocale = ["sr-Thai-RS", "de", "zh-CN"];
23 assert.compareArray(Intl.Segmenter.supportedLocalesOf(multiLocale, {localeMatcher: "lookup"}), multiLocale);
24
25 reportCompare(0, 0);