-
Notifications
You must be signed in to change notification settings - Fork 479
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
Tests combinations max-min fractionDigits and Significant digits #3515
Tests combinations max-min fractionDigits and Significant digits #3515
Conversation
97b4940
to
1b94e1d
Compare
test/intl402/NumberFormat/test-option-roundingPriority-mixed-options.js
Outdated
Show resolved
Hide resolved
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.
I think the test matrix approach looks good, I trust that the champions know best what the correct format outputs should be 😄 Currently they are all the same though, I assume that's because it's a draft and the real values will be entered later?
One improvement might be to use keys that explain what that particular line tests. e.g.
var optionsMatrix = {
'same-minimums': { useGrouping: false, minimumSignificantDigits: 2, minimumFractionDigits: 2 },
'min-sd-larger': { useGrouping: false, minimumSignificantDigits: 3, minimumFractionDigits: 1 },
...
and
'auto': {
'same-minimums': { '1': '1.0', ...
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.
I think this is basically correct — I didn't check the rounding results exhaustively, but I sampled maybe about 40% of them.
If you wanted to add some comments to explain what is going on in each entry, I'm sure that would really help implementors debug their implementations. For example, in the expected results matrix,
'morePrecision': {
// 2-21 significant digits
'same-minimums': { ... },
// 1-2 significant digits or 0-2 fraction digits, whichever is more precise
'same-maximums': { ... },
// 3-21 significant digits
'minSd-larger-minFd': { ... },
and in the options matrix, for example,
// max significant digits wins
'same-minimums': { ... },
// max digits equal, result with more precision wins
'same-maximums': { ... },
etc.
'minSd-smaller-minFd' :{ minimumSignificantDigits: 1, minimumFractionDigits: 3}, | ||
'minSd-smaller-maxFd' :{ minimumSignificantDigits: 1, maximumFractionDigits: 3}, | ||
'minSd-larger-maxFd' :{ minimumSignificantDigits: 3, maximumFractionDigits: 1}, | ||
'maxSd-larger-minFd' :{ maximumSignificantDigits: 3, minimumFractionDigits: 1}, |
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.
What is supposed to happen in this case? My understanding is that maximumSignificantDigits
and maximumFractionDigits
are both 3, so it depends on the rounding result itself, which one wins the conflict. Is that correct?
test/intl402/NumberFormat/test-option-roundingPriority-mixed-options.js
Outdated
Show resolved
Hide resolved
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.
OK by me, I still think the comments I suggested would be useful if you have time to add them, but what you have is already fine.
If it's ok for you I can work on those comments while doing pending tasks in upcoming PRs:
That way we can land current tests |
#3508 (comment)
Todo's for other tests files:
The goal's to have correct matrix results aligned with spec
cc @sffc @FrankYFTang