Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

is there a standard name for opposite of assert?

What I should name of a function that quits execution a condition equals true ? Deny ? Is there a common established name ?

anti_assert(1=1, errmsg);

For me it is easier to go that way because then it is possible to do macro in c/c++ like:

#define anti_assert(expression) anti_assert(expresstion, #expression)

And then in log I have the fragment of code that triggered the issue.

like image 852
rsk82 Avatar asked Feb 14 '23 20:02

rsk82


1 Answers

I really like refute from Ruby's Minitest. Makes it instantly clear what we want (assert) vs what we don't want (refute).

like image 145
guillaume31 Avatar answered Mar 12 '23 13:03

guillaume31