-
Notifications
You must be signed in to change notification settings - Fork 72
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 assert approx and assert false #25
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🥇 |
function assertFalse(bool condition) internal { | ||
if (condition) { | ||
emit log("Error: Assertion Failed"); | ||
fail(); | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this simply call assertTrue
like this?
function assertFalse(bool condition) internal {
assertTrue(!condition);
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes we can also do this !
This PR has been opened to add 2 functionalities:
assertApproxEq
: allows to do testing with an approximation given as input (to avoid small rounding errors).assertFalse
: The opposite ofassertFalse
for convenience.It seems there is a duplicate PR for
assertFalse
here so we can just merge it and only add the commit for theassertApproxEq
from this PR or simply just merge this PR 🙂Thanks for you feedbacks!