summaryrefslogtreecommitdiff
path: root/deps/v8/test/intl/regress-11350.js
blob: 6c9f82780f379a2529cb7a746dbe26a64b6839e2 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// 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.

// Test Long Locale handle minimize and maximize correctly.

let ext = "-u-cu-eur-em-default-hc-h23-ks-level1-lb-strict-lw-normal-" +
          "ms-metric-nu-latn-rg-atzzzz-sd-atat1-ss-none-tz-atvie-va-posix";

// Test maximize()
assertEquals ("de-Latn-DE" + ext,
    (new Intl.Locale("de" + ext)).maximize().toString());

assertEquals ("de-Latn-DE" + ext,
    (new Intl.Locale("de-DE" + ext)).maximize().toString());

assertEquals ("de-Latn-DE" + ext,
    (new Intl.Locale("de-Latn" + ext)).maximize().toString());

assertEquals ("de-Latn-DE" + ext,
    (new Intl.Locale("de-Latn-DE" + ext)).maximize().toString());

assertEquals ("de-Hant-DE" + ext,
    (new Intl.Locale("de-Hant" + ext)).maximize().toString());

assertEquals ("de-Hant-AT" + ext,
    (new Intl.Locale("de-Hant-AT" + ext)).maximize().toString());

assertEquals ("de-Latn-AT" + ext,
    (new Intl.Locale("de-AT" + ext)).maximize().toString());

// Test minimize()
assertEquals ("de" + ext,
    (new Intl.Locale("de-Latn-DE" + ext)).minimize().toString());

assertEquals ("de" + ext,
    (new Intl.Locale("de-Latn" + ext)).minimize().toString());

assertEquals ("de" + ext,
    (new Intl.Locale("de-DE" + ext)).minimize().toString());

assertEquals ("de-AT" + ext,
    (new Intl.Locale("de-Latn-AT" + ext)).minimize().toString());

assertEquals ("de-Hant" + ext,
    (new Intl.Locale("de-Hant" + ext)).minimize().toString());

assertEquals ("de-Hant-AT" + ext,
    (new Intl.Locale("de-Hant-AT" + ext)).minimize().toString());