mirror of
https://github.com/tc39/test262.git
synced 2025-07-23 14:04:51 +02:00
Fixup of 'Add version of intl402/6.2.3.js...'
This commit is contained in:
parent
19caba81c4
commit
3c94ba0116
@ -4,10 +4,12 @@
|
|||||||
// This code is governed by the BSD license found in the LICENSE file.
|
// This code is governed by the BSD license found in the LICENSE file.
|
||||||
|
|
||||||
/*---
|
/*---
|
||||||
es5id: 6.2.3
|
esid: intl.getcanonicallocales
|
||||||
description: Tests that language tags are canonicalized in return values.
|
description: Tests the getCanonicalLocales for locale tags.
|
||||||
author: Norbert Lindenberg
|
info: >
|
||||||
includes: [testIntl.js]
|
Intl.getCanonicalLocales (locales)
|
||||||
|
1. Let ll be ? CanonicalizeLocaleList(locales).
|
||||||
|
2. Return CreateArrayFromList(ll).
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var canonicalizedTags = {
|
var canonicalizedTags = {
|
||||||
@ -19,7 +21,6 @@ var canonicalizedTags = {
|
|||||||
"cmn-hans-cn": ["cmn-Hans-CN", "cmn-Hans", "cmn"],
|
"cmn-hans-cn": ["cmn-Hans-CN", "cmn-Hans", "cmn"],
|
||||||
"es-419": ["es-419", "es"],
|
"es-419": ["es-419", "es"],
|
||||||
"es-419-u-nu-latn": ["es-419-u-nu-latn", "es-419", "es", "es-u-nu-latn"],
|
"es-419-u-nu-latn": ["es-419-u-nu-latn", "es-419", "es", "es-u-nu-latn"],
|
||||||
// -u-ca is incomplete, so it will not show up in resolvedOptions().locale
|
|
||||||
"cmn-hans-cn-u-ca-t-ca-x-t-u": ["cmn-Hans-CN-t-ca-u-ca-x-t-u", "cmn-Hans-CN-t-ca-x-t-u", "cmn-Hans-CN-t-ca-x-t", "cmn-Hans-CN-t-ca", "cmn-Hans-CN", "cmn-Hans", "cmn"],
|
"cmn-hans-cn-u-ca-t-ca-x-t-u": ["cmn-Hans-CN-t-ca-u-ca-x-t-u", "cmn-Hans-CN-t-ca-x-t-u", "cmn-Hans-CN-t-ca-x-t", "cmn-Hans-CN-t-ca", "cmn-Hans-CN", "cmn-Hans", "cmn"],
|
||||||
"de-gregory-u-ca-gregory": ["de-gregory-u-ca-gregory", "de-gregory", "de-u-ca-gregory", "de"],
|
"de-gregory-u-ca-gregory": ["de-gregory-u-ca-gregory", "de-gregory", "de-u-ca-gregory", "de"],
|
||||||
"no-nyn": ["nn"],
|
"no-nyn": ["nn"],
|
||||||
@ -33,10 +34,11 @@ var canonicalizedTags = {
|
|||||||
"x-foo": ["x-foo"]
|
"x-foo": ["x-foo"]
|
||||||
};
|
};
|
||||||
|
|
||||||
Object.getOwnPropertyNames(canonicalizedTags).forEach(function (tag) {
|
Object.keys(canonicalizedTags).forEach(function (tag) {
|
||||||
let locale = Intl.getCanonicalLocales(tag);
|
let locale = Intl.getCanonicalLocales(tag);
|
||||||
if (!canonicalizedTags[tag].includes(locale[0])) {
|
let expected = canonicalizedTags[tag];
|
||||||
$ERROR("For " + tag + " got " + locale + "; expected one of " +
|
assert(
|
||||||
canonicalizedTags[tag].join(", ") + ".");
|
expected.includes(locale[0]),
|
||||||
}
|
`For ${tag} got ${locale}; expected one of ${expected.join(", ")}`,
|
||||||
|
);
|
||||||
});
|
});
|
Loading…
x
Reference in New Issue
Block a user