-
-
Notifications
You must be signed in to change notification settings - Fork 769
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
ICU-22781 Uncomment and enable constant denominator tests #3385
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.
Where's the part where you actually test that formatting does he right thing with this unit?
// `portion-per-1e9` is treated as a unit in CLDR, | ||
// the unit does not have a constant denominator. | ||
// This issue should be addressed in CLDR & ICU. | ||
{"portion-per-1000000000", 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.
Is there an outstanding ticket for this? If so, you should probably include the ticket number (or a link) here.
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.
portion-per-1e9
is treated as a precomputed form for translation, not a single unit.
We shouldn't test for the wrong behavior.
That being said, given the schedule, and the fact that we are going fix the problem fully in 48, it's ok for {"portion-per-1000000000", 1000000000},
be present but commented out.
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.
Sure, I have added it back with logKnownIssue
so it can be addressed in the next release.
// `portion-per-1e9` is treated as a unit in CLDR, | ||
// the unit does not have a constant denominator. | ||
// This issue should be addressed in CLDR & ICU. | ||
{"portion-per-1000000000", 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.
portion-per-1e9
is treated as a precomputed form for translation, not a single unit.
We shouldn't test for the wrong behavior.
That being said, given the schedule, and the fact that we are going fix the problem fully in 48, it's ok for {"portion-per-1000000000", 1000000000},
be present but commented out.
// This issue should be addressed in CLDR & ICU. | ||
new ConstantDenominatorTestCase("portion-per-1000000000", 0), | ||
new ConstantDenominatorTestCase("portion-per-1e9", 0), | ||
new ConstantDenominatorTestCase("portion-per-1E9", 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.
Same here.
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.
done, I added also a logKnownIssue
@@ -1205,6 +1205,7 @@ void UnitsTest::testUnitsConstantsDenomenator() { | |||
{"portion-per-7", 7}, | |||
{"portion-per-8", 8}, | |||
{"portion-per-9", 9}, |
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.
These cases don't exist in the Java tests.
Is there a good reason to have them?
Are they testing something interesting, that is not well covered by other cases?
They they should also be in Java.
If they don't actually exercise anything interesting, we should not have them in C/C++ either.
In general the tests in C++ and Java should be the same, unless there are very good reasons (for example Java testing for all kind of types that don't exist in C++)
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.
now , c++ and java are identical, sorry for this small confusion.
@richgillam : for testing the formatting: |
c18f728
to
573f7e8
Compare
Hooray! The files in the branch are the same across the force-push. 😃 ~ Your Friendly Jira-GitHub PR Checker Bot |
Thank you. |
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.
Looks okay to me, but I think you should get approval from somebody who raised objections the last time around.
{"portion-per-1000000000000000", 1000000000000000}, | ||
{"portion-per-10000000000000000", 10000000000000000}, | ||
{"portion-per-100000000000000000", 100000000000000000}, | ||
{"portion-per-1000000000000000000", 1000000000000000000}, |
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.
Same issue as in the other PRs: If these are all expected to fail and are being covered by logKnownIssue()
in the code, put some sort of comment next to the actual test case to indicate that (the ticket number you had in the earlier version of these changes works, for example). Same thing further down in here.
An alternative approach would be to add a knownIssueTicketNumber
property to your TestCase
object-- the test code would look for that and, if it's populated, skip the test and pass it to logKnownIssue
.
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.
done now :)
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.
Is line 1219 the only one that's failing? If so, we're good here.
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.
Yes, it is the only one that is failing.
573f7e8
to
771dad2
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
@macchiati , can you take a look ? |
Description:
Re-enable previously commented out tests for constant denominators in units tests for both ICU4C and ICU4J. This includes tests for:
Added notes about potential CLDR-related edge cases for certain unit representations.
Checklist