Skip to content
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

Initial tests for BigInt.prototype.toLocaleString(). #2126

Merged
merged 2 commits into from
Apr 10, 2019

Conversation

Ms2ger
Copy link
Contributor

@Ms2ger Ms2ger commented Apr 9, 2019

Many of these tests are heavily based on the tests for
Number.prototype.toLocaleString().

Many of these tests are heavily based on the tests for
Number.prototype.toLocaleString().
@Ms2ger
Copy link
Contributor Author

Ms2ger commented Apr 9, 2019

One bug in V8: it doesn't call ThisBigIntValue() in toLocaleString().

CC @gsathya @FrankYFTang

Copy link
Contributor

@FrankYFTang FrankYFTang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the following errors while I try to run test in v8

No license found in: intl402/BigInt/prototype/toLocaleString/builtin
No license found in: intl402/BigInt/prototype/toLocaleString/default-options-object-prototype
No license found in: intl402/BigInt/prototype/toLocaleString/length
No license found in: intl402/BigInt/prototype/toLocaleString/returns-same-results-as-NumberFormat
No license found in: intl402/BigInt/prototype/toLocaleString/taint-Intl-NumberFormat
No license found in: intl402/BigInt/prototype/toLocaleString/this-value-invalid
No license found in: intl402/BigInt/prototype/toLocaleString/throws-same-exceptions-as-NumberFormat

@@ -0,0 +1,28 @@
// Copyright 2012-2019 Mozilla Corporation; Igalia, S.L. All rights reserved.
// This code is governed by the license found in the LICENSE file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got the following error
"No license found in: intl402/BigInt/prototype/toLocaleString/builtin"

@@ -0,0 +1,14 @@
// Copyright 2013-2019 Mozilla Corporation; Igalia, S.L. All rights reserved.
// This code is governed by the license found in the LICENSE file.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a "No license found in: intl402/BigInt/prototype/toLocaleString/taint-Intl-NumberFormat"
I think you need to change the line "// This code is governed by the license found in the LICENSE file." to
something like "// This code is governed by the BSD license found in the LICENSE file."

for (const value of invalidValues) {
assert.throws(TypeError, function() {
BigInt.prototype.toLocaleString.call(value);
}, "BigInt.prototype.toLocaleString did not reject this = " + value + ".");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the ' + value + ' won't work for the test case of Symbol()

@FrankYFTang
Copy link
Contributor

One bug in V8: it doesn't call ThisBigIntValue() in toLocaleString().

CC @gsathya @FrankYFTang

Just FYI
https://bugs.chromium.org/p/v8/issues/detail?id=9109 for v8 bug and
https://chromium-review.googlesource.com/c/v8/v8/+/1559214 for fix in v8

---*/

var invalidValues = [
// undefined,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please either remove the // or remove the whole line

@leobalter leobalter merged commit 8e5ab69 into tc39:master Apr 10, 2019
@littledan
Copy link
Member

It would be nice to additionally include tests that:

  • Some locale other than en-US works, e.g., using the appropriate thousands separator
  • Some value outside of Number range works, without rounding

@gsathya
Copy link
Member

gsathya commented Apr 23, 2019

@Ms2ger I still get the missing license error that @FrankYFTang mentioned. These tests need to be updated:

No license found in: intl402/BigInt/prototype/toLocaleString/builtin
No license found in: intl402/BigInt/prototype/toLocaleString/default-options-object-prototype
No license found in: intl402/BigInt/prototype/toLocaleString/length
No license found in: intl402/BigInt/prototype/toLocaleString/returns-same-results-as-NumberFormat
No license found in: intl402/BigInt/prototype/toLocaleString/taint-Intl-NumberFormat
No license found in: intl402/BigInt/prototype/toLocaleString/this-value-invalid
No license found in: intl402/BigInt/prototype/toLocaleString/throws-same-exceptions-as-NumberFormat

@Ms2ger Ms2ger deleted the bigint-numberformat branch April 24, 2019 13:37
@Ms2ger
Copy link
Contributor Author

Ms2ger commented Apr 24, 2019

@gsathya I can't reproduce that locally on master. Could you clarify where you see those errors?

@Ms2ger
Copy link
Contributor Author

Ms2ger commented Apr 24, 2019

More tests: #2136

@gsathya
Copy link
Member

gsathya commented Apr 24, 2019

@gsathya I can't reproduce that locally on master. Could you clarify where you see those errors?

@Ms2ger, these tests break the license regexp in the test262 harness:
https://github.com/test262-utils/test262-harness-py/blob/master/src/parseTestRecord.py#L27

@Ms2ger
Copy link
Contributor Author

Ms2ger commented Apr 25, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants