Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
test262
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pmaksimo
test262
Commits
3c94ba01
Commit
3c94ba01
authored
7 years ago
by
Valerie R Young
Browse files
Options
Downloads
Patches
Plain Diff
Fixup of 'Add version of intl402/6.2.3.js...'
parent
19caba81
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/intl402/Intl/getCanonicalLocales/success_cases.js
+12
-10
12 additions, 10 deletions
test/intl402/Intl/getCanonicalLocales/success_cases.js
with
12 additions
and
10 deletions
test/intl402/
6.2.3_b
.js
→
test/intl402/
Intl/getCanonicalLocales/success_cases
.js
+
12
−
10
View file @
3c94ba01
...
...
@@ -4,10 +4,12 @@
// This code is governed by the BSD license found in the LICENSE file.
/*---
es5id: 6.2.3
description: Tests that language tags are canonicalized in return values.
author: Norbert Lindenberg
includes: [testIntl.js]
esid: intl.getcanonicallocales
description: Tests the getCanonicalLocales for locale tags.
info: >
Intl.getCanonicalLocales (locales)
1. Let ll be ? CanonicalizeLocaleList(locales).
2. Return CreateArrayFromList(ll).
---*/
var
canonicalizedTags
=
{
...
...
@@ -19,7 +21,6 @@ var canonicalizedTags = {
"
cmn-hans-cn
"
:
[
"
cmn-Hans-CN
"
,
"
cmn-Hans
"
,
"
cmn
"
],
"
es-419
"
:
[
"
es-419
"
,
"
es
"
],
"
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
"
],
"
de-gregory-u-ca-gregory
"
:
[
"
de-gregory-u-ca-gregory
"
,
"
de-gregory
"
,
"
de-u-ca-gregory
"
,
"
de
"
],
"
no-nyn
"
:
[
"
nn
"
],
...
...
@@ -33,10 +34,11 @@ var canonicalizedTags = {
"
x-foo
"
:
[
"
x-foo
"
]
};
Object
.
getOwnPropertyName
s
(
canonicalizedTags
).
forEach
(
function
(
tag
)
{
Object
.
key
s
(
canonicalizedTags
).
forEach
(
function
(
tag
)
{
let
locale
=
Intl
.
getCanonicalLocales
(
tag
);
if
(
!
canonicalizedTags
[
tag
].
includes
(
locale
[
0
]))
{
$ERROR
(
"
For
"
+
tag
+
"
got
"
+
locale
+
"
; expected one of
"
+
canonicalizedTags
[
tag
].
join
(
"
,
"
)
+
"
.
"
);
}
let
expected
=
canonicalizedTags
[
tag
];
assert
(
expected
.
includes
(
locale
[
0
]),
`For
${
tag
}
got
${
locale
}
; expected one of
${
expected
.
join
(
"
,
"
)}
`
,
);
});
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment