2018-10-05 01:57:05 +00:00
|
|
|
// Copyright 2018 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-segmenter
|
|
|
|
assertEquals(
|
|
|
|
typeof Intl.Segmenter.supportedLocalesOf,
|
|
|
|
"function",
|
|
|
|
"Intl.Segmenter.supportedLocalesOf should be a function"
|
|
|
|
);
|
|
|
|
|
2018-10-15 18:21:43 +00:00
|
|
|
const undef = Intl.Segmenter.supportedLocalesOf();
|
2018-10-05 01:57:05 +00:00
|
|
|
assertEquals([], undef);
|
|
|
|
|
2018-10-15 18:21:43 +00:00
|
|
|
const empty = Intl.Segmenter.supportedLocalesOf([]);
|
2018-10-05 01:57:05 +00:00
|
|
|
assertEquals([], empty);
|
|
|
|
|
2018-10-15 18:21:43 +00:00
|
|
|
const strLocale = Intl.Segmenter.supportedLocalesOf("sr");
|
2018-10-05 01:57:05 +00:00
|
|
|
assertEquals("sr", strLocale[0]);
|
|
|
|
|
2018-10-15 18:21:43 +00:00
|
|
|
const multiLocale = ["sr-Thai-RS", "de", "zh-CN"];
|
2018-10-05 01:57:05 +00:00
|
|
|
assertEquals(multiLocale, Intl.Segmenter.supportedLocalesOf(multiLocale));
|