summaryrefslogtreecommitdiff
path: root/deps/v8/test/intl/collator/check-co-option.js
blob: 477d00a0453052ff003992ade4be0afc7a74febf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// 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.

let invalid_co = [
  "invalid",
  "search",
  "standard",
  "abce",
];

let valid_locales = [
  "zh-u-co-zhuyin",
  "zh-u-co-stroke",
  "ar-u-co-compat",
  "en-u-co-emoji",
  "en-u-co-eor",
  "zh-Hant-u-co-pinyin",
  "ko-u-co-searchjl",
  "ja-u-co-unihan",
];

invalid_co.forEach(function(co) {
  let col = new Intl.Collator(["en-u-co-" + co]);
  assertEquals("en", col.resolvedOptions().locale);
}
);

valid_locales.forEach(function(l) {
  let col = new Intl.Collator([l + "-fo-obar"]);
  assertEquals(l, col.resolvedOptions().locale);
}
);