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
5b0f7e19
Commit
5b0f7e19
authored
6 years ago
by
Ms2ger
Committed by
Rick Waldron
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Intl.Locale: Refactor the tests for the numeric option.
parent
1ac1649c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/intl402/Locale/constructor-options-numeric-undefined.js
+53
-0
53 additions, 0 deletions
test/intl402/Locale/constructor-options-numeric-undefined.js
test/intl402/Locale/constructor-options-numeric-valid.js
+10
-9
10 additions, 9 deletions
test/intl402/Locale/constructor-options-numeric-valid.js
with
63 additions
and
9 deletions
test/intl402/Locale/constructor-options-numeric-undefined.js
0 → 100644
+
53
−
0
View file @
5b0f7e19
// Copyright 2018 Igalia, S.L. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-intl.locale
description: Verifies the behavior of an undefined numeric option to the Locale constructor.
info: |
Intl.Locale( tag [, options] )
...
24. Let kn be ? GetOption(options, "numeric", "boolean", undefined, undefined).
25. If kn is not undefined, set kn to ! ToString(kn).
...
30. Let r be ! ApplyUnicodeExtensionToTag(tag, opt, relevantExtensionKeys).
...
ApplyUnicodeExtensionToTag( tag, options, relevantExtensionKeys )
...
8. Let locale be the String value that is tag with all Unicode locale extension sequences removed.
9. Let newExtension be ! CanonicalizeUnicodeExtension(attributes, keywords).
10. If newExtension is not the empty String, then
a. Let locale be ! InsertUnicodeExtension(locale, newExtension).
...
CanonicalizeUnicodeExtension( attributes, keywords )
...
4. Repeat for each element entry of keywords in List order,
a. Let keyword be entry.[[Key]].
b. If entry.[[Value]] is not the empty String, then
i. Let keyword be the string-concatenation of keyword, "-", and entry.[[Value]].
c. Append keyword to fullKeywords.
...
features: [Intl.Locale]
---*/
const
options
=
{
numeric
:
undefined
};
assert
.
sameValue
(
new
Intl
.
Locale
(
'
en
'
,
options
).
toString
(),
"
en
"
,
);
assert
.
sameValue
(
new
Intl
.
Locale
(
'
en-u-kn-true
'
,
options
).
toString
(),
"
en-u-kn-true
"
,
);
if
(
"
numeric
"
in
Intl
.
Locale
.
prototype
)
{
assert
.
sameValue
(
new
Intl
.
Locale
(
'
en-u-kf-lower
'
,
options
).
numeric
,
undefined
,
);
}
This diff is collapsed.
Click to expand it.
test/intl402/Locale/constructor-options-numeric-valid.js
+
10
−
9
View file @
5b0f7e19
...
@@ -36,24 +36,25 @@ features: [Intl.Locale]
...
@@ -36,24 +36,25 @@ features: [Intl.Locale]
---*/
---*/
const
validNumericOptions
=
[
const
validNumericOptions
=
[
[
undefined
,
undefined
],
[
false
,
false
],
[
false
,
"
false
"
],
[
true
,
true
],
[
true
,
"
true
"
],
[
null
,
false
],
[
null
,
"
false
"
],
[
0
,
false
],
[
0
,
"
false
"
],
[
0.5
,
true
],
[
0.5
,
"
true
"
],
[
"
true
"
,
true
],
[{
valueOf
()
{
return
false
;
}
},
"
true
"
],
[
"
false
"
,
true
],
[{
valueOf
()
{
return
false
;
}
},
true
],
];
];
for
(
const
[
numeric
,
expected
]
of
validNumericOptions
)
{
for
(
const
[
numeric
,
expected
]
of
validNumericOptions
)
{
const
options
=
{
numeric
};
const
options
=
{
numeric
};
assert
.
sameValue
(
assert
.
sameValue
(
new
Intl
.
Locale
(
'
en
'
,
options
).
toString
(),
new
Intl
.
Locale
(
'
en
'
,
options
).
toString
(),
expected
?
(
"
en-u-kn-
"
+
expected
)
:
"
en
"
"
en-u-kn-
"
+
expected
);
);
assert
.
sameValue
(
assert
.
sameValue
(
new
Intl
.
Locale
(
'
en-u-kn-true
'
,
options
).
toString
(),
new
Intl
.
Locale
(
'
en-u-kn-true
'
,
options
).
toString
(),
"
en-u-kn-
"
+
(
expected
||
"
true
"
)
"
en-u-kn-
"
+
expected
);
);
if
(
"
numeric
"
in
Intl
.
Locale
.
prototype
)
{
if
(
"
numeric
"
in
Intl
.
Locale
.
prototype
)
{
...
...
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