Simplify logical && || operator eval
This commit is contained in:
21
unittests/logical_short_circuiting.chai
Normal file
21
unittests/logical_short_circuiting.chai
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
def shouldnt_execute()
|
||||
{
|
||||
assert(false)
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (false && shouldnt_execute()) {
|
||||
}
|
||||
|
||||
if (true || shouldnt_execute()) {
|
||||
}
|
||||
|
||||
|
||||
if (false || false || false || true || shouldnt_execute()) {
|
||||
}
|
||||
|
||||
|
||||
if (true && true && true && false && shouldnt_execute()) {
|
||||
}
|
Reference in New Issue
Block a user