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

Add tests for reasoncode comparison #801

Merged
merged 1 commit into from
Jan 20, 2024
Merged

Conversation

PierreF
Copy link
Contributor

@PierreF PierreF commented Jan 14, 2024

ReasonCodes object could be compared to a number but they couldn't:

  • be used in inequality with number like in reason_code > 0
  • be used in equality with string (because code was broken, it's was intended to work), like in reason_code == "Success"

The string comparison if useful IMO. The inequality is there more for compatibility with code that used to do rc > 0 and want to do reason_code > 0.

@PierreF PierreF merged commit 80701e4 into master Jan 20, 2024
21 checks passed
@PierreF PierreF deleted the reason-code-comparison branch January 20, 2024 13:28
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.

1 participant