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 arithmetic compasion checkers #178

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

babakks
Copy link

@babakks babakks commented Feb 14, 2025

This PR adds the following checkers:

  • IsLessThan
  • IsLessThanOrEqual
  • IsGreaterThan
  • IsGreaterThanOrEqual

These new checkers are based on a new generic binary arithmetic operator checker, named binaryArithmeticChecker, which converts operands to *big.Float values for simple comparison.

Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
Signed-off-by: Babak K. Shandiz <[email protected]>
@babakks
Copy link
Author

babakks commented Feb 14, 2025

@frankban Can you please review this PR?

Copy link
Owner

@frankban frankban left a comment

Choose a reason for hiding this comment

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

Looks good with a question. Thanks!

}
}

func TestBinaryArithmeticCheckerValidation(t *testing.T) {
Copy link
Owner

Choose a reason for hiding this comment

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

Do we need all these tests? Isn't one test for the value and one for the reference sufficient? Also, can this be just part of the checker tests?

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