added test case for or operator

This commit is contained in:
Arne Döring 2018-07-19 22:42:48 +02:00
commit 48697dc5bb
2 changed files with 17 additions and 3 deletions

View file

@ -79,3 +79,17 @@ static:
assert fooSym.kind in {nnkOpenSymChoice, nnkClosedSymChoice}
assert fooSym.eqIdent("fOO")
assertNot fooSym.eqIdent("bar")
var empty: NimNode
var myLit = newLit("str")
assert( (empty or myLit) == myLit )
empty = newEmptyNode()
assert( (empty or myLit) == myLit )
proc bottom(): NimNode =
quit("may not be evaluated")
assert( (myLit or bottom()) == myLit )