-
Notifications
You must be signed in to change notification settings - Fork 482
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update tointlmathematicalvalue tests #3772
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, @romulocintra!
---*/ | ||
|
||
const nf = Intl.NumberFormat(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR currently tests only the Number path. Please also test the String path.
Please test the following inputs (and, for additional coverage, the negative versions of each):
// Values that should *not* overflow to ∞:
Number.MAX_VALUE
String(Number.MAX_VALUE)
Number.MAX_VALUE / 2
String(Number.MAX_VALUE / 2)
1e308
"1e308"
"1" + Array(308).fill("0").join("")
Array(309).fill("1").join("")
// Values that should overflow to ∞:
Number.MAX_VALUE * 2
1e309
"1e309"
"1" + Array(309).fill("0").join("")
Array(310).fill("1").join("")
// Values that should *not* underflow to 0:
// Note: Please set the rounding strategy to maximumSignificantDigits: 10
Number.MIN_VALUE
String(Number.MIN_VALUE)
Number.MIN_VALUE * 2
String(Number.MIN_VALUE * 2)
1e-324
"1e-324"
"1.1111111111111111111e-324" // should round to 10 significant digits
"0." + Array(323).fill("0").join("") + "1"
"0." + Array(323).fill("0").join("") + Array(30).fill("1").join("") // should round to 10 significant digits
// Values that should underflow to zero:
Number.MIN_VALUE / 2
1e-325
"1e-325"
"1.1111111111111111111e-325"
"0." + Array(324).fill("0").join("") + "1"
"0." + Array(324).fill("0").join("") + Array(30).fill("1").join("")
Added tests for Limit exponent of intl mathematical value #98