| 1 |
// Copyright 2016 Mozilla Corporation. All rights reserved. |
| 2 |
// This code is governed by the license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
esid: sec-intl.getcanonicallocales |
| 6 |
description: Tests the getCanonicalLocales function for duplicate locales scenario. |
| 7 |
info: | |
| 8 |
8.2.1 Intl.getCanonicalLocales (locales) |
| 9 |
1. Let ll be ? CanonicalizeLocaleList(locales). |
| 10 |
2. Return CreateArrayFromList(ll). |
| 11 |
includes: [compareArray.js] |
| 12 |
---*/ |
| 13 |
|
| 14 |
assert(compareArray( |
| 15 |
Intl.getCanonicalLocales( |
| 16 |
['ab-cd', 'ff', 'de-rt', 'ab-Cd']), ['ab-CD', 'ff', 'de-RT'])); |
| 17 |
|
| 18 |
var locales = Intl.getCanonicalLocales(["en-US", "en-US"]); |
| 19 |
assert(compareArray(locales, ['en-US']), 'en-US'); |