forked from v8/v8
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix m(in|ax)imize() with long locale
Bug: v8:11350 Change-Id: Ic34b40c4d88d6c2a0ac62bbebee4e2a95ebba826 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2648973 Commit-Queue: Frank Tang <[email protected]> Reviewed-by: Jakob Kummerow <[email protected]> Cr-Commit-Position: refs/heads/master@{#72417}
- Loading branch information
1 parent
8432c46
commit 3e55523
Showing
2 changed files
with
97 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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()); |