Update tests for Decimal successor/predecessor for 2.0.0 - #147
Open
dehall wants to merge 2 commits into
Open
Conversation
Author
|
I suppose there's also option 4, add versioning info to the <test name="PredecessorOf1D" version="1.0">
<expression>predecessor of 1.0</expression>
<output versionTo="1.5.3">0.99999999</output>
<output version="2.0">0.9</output>
</test>But that's not currently supported by the schema and so is a larger change with more downstream impact |
cmoesel
self-requested a review
September 9, 2026 14:57
cmoesel
approved these changes
Sep 9, 2026
cmoesel
left a comment
Member
There was a problem hiding this comment.
Approved (on behalf of MITRE's JS cql-execution team).
That said, I noticed that there are predecessor tests for quantities but there are no successor tests for quantities. I'd accept this PR as-is because it is an improvement, but it would be a bonus if you could add successor tests for quantities as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CQL 2.0.0 changed the behavior of
successor of Decimalandpredecessor of Decimalto be aware of the precision of the Decimal. Previously these operators always added/subtracted0.00000001. This PR marks the existing tests withversionTo="1.5.3"and adds new tests withversion="2.0"and the updated behavior.Note: I looked for other instances of an operator's behavior changing across versions and didn't see anything obvious. The only other instance I see of
versionTois on "DateTimeComponentFromTimezoneOffset" where the operator name changed between 1.3 and 1.4 and so the test name changed.I point that out to say, I think this PR could set a precedent for this sort of scenario so I encourage the maintainers to be nitpicky. 3 alternatives I considered:
version="2.0"and updating the expected result