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
42ebb3a9
Commit
42ebb3a9
authored
8 years ago
by
vabr-g
Committed by
Leo Balter
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add test for NumberFormat default minimumSignificantDigits (#864)
parent
6b09ad04
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/intl402/NumberFormat/default-minimum-singificant-digits.js
+21
-0
21 additions, 0 deletions
...ntl402/NumberFormat/default-minimum-singificant-digits.js
with
21 additions
and
0 deletions
test/intl402/NumberFormat/default-minimum-singificant-digits.js
0 → 100644
+
21
−
0
View file @
42ebb3a9
// Copyright (C) 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: Tests that the default value of minimumSignificantDigits is 1.
esid: sec-setnfdigitoptions
---*/
// maximumSignificantDigits needs to be in range from minimumSignificantDigits
// to 21 (both inclusive). Setting maximumSignificantDigits to 0 will throw a
// RangeError if the (default) minimumSignificantDigits is at least 1.
assert
.
throws
(
RangeError
,
function
()
{
Intl
.
NumberFormat
(
undefined
,
{
maximumSignificantDigits
:
0
});
});
// If nothing is thrown, check that the options are resolved appropriately.
var
res
=
Intl
.
NumberFormat
(
undefined
,
{
maximumSignificantDigits
:
1
})
assert
.
sameValue
(
Object
.
getPrototypeOf
(
res
),
Intl
.
NumberFormat
.
prototype
,
'
result is an instance of NumberFormat
'
)
assert
.
sameValue
(
res
.
resolvedOptions
().
minimumSignificantDigits
,
1
,
'
default minimumSignificantDigits
'
)
assert
.
sameValue
(
res
.
resolvedOptions
().
maximumSignificantDigits
,
1
,
'
sets maximumSignificantDigits
'
)
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