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

Improved isUnsigned to check attribute minimum more carefully #395

Merged
merged 1 commit into from
Oct 2, 2024

Conversation

seanm
Copy link
Contributor

@seanm seanm commented Sep 30, 2024

The previous implementation checked the validation predicate for a string containing literally ">= 0". But if an attribute's minimum was, for example, 1 instead of 0, the test would fail because the string would be ">= 1". But when a minimum is 1 we still want to use unsigned, but weren't getting unsigned because of this.

Updated the code to instead look for the string "SELF >=" and then inspect the number that comes after (if any). Then we can in fact correctly check that the minimus is >= 0, thus allowing unsigned to be used in those cases too.

The previous implementation checked the validation predicate for a string containing literally ">= 0".  But if an attribute's minimum was, for example, 1 instead of 0, the test would fail because the string would be ">= 1".  But when a minimum is 1 we still want to use `unsigned`, but weren't getting `unsigned` because of this.

Updated the code to instead look for the string "SELF >=" and then inspect the number that comes after (if any). Then we can in fact correctly check that the minimus is >= 0, thus allowing `unsigned` to be used in those cases too.
@rentzsch rentzsch merged commit 8d463ac into rentzsch:master Oct 2, 2024
@seanm
Copy link
Contributor Author

seanm commented Oct 2, 2024

Thanks @rentzsch !

After all these years, we are updating from mogen 1.27. :)

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