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

Fix certain symbols being incorrectly identified as incomplete boolean values #798

Merged
merged 1 commit into from
Jul 11, 2024

Conversation

popematt
Copy link
Contributor

Issue #, if available:

None

Description of changes:

Fixes a small bug in match_bool that was incorrectly reporting things like "fal" as incomplete booleans rather than as non-matches.

Also adds test cases, and updates existing test cases with a more concise macro and the ability to specify whether a value is a mismatch vs an incomplete match.

You may want to view this PR in the "split" diff view.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Comment on lines -1065 to +1068
alt((value(true, tag("true")), value(false, tag("false")))),
alt((
value(true, complete_tag("true")),
value(false, complete_tag("false")),
)),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

🗺️ This is the logic change. The rest of the changes in this file are (a) separating out mismatch and incomplete in the tests cases, and (b) introducing a macro to eliminate most of the nested functions, boilerplate code, and repeated code in the test cases.

@popematt popematt merged commit 99ec403 into amazon-ion:main Jul 11, 2024
22 of 26 checks passed
@popematt popematt deleted the master branch July 11, 2024 14:16
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.

2 participants