diff options
Diffstat (limited to 'tests/macros/tmacro1.nim')
-rw-r--r-- | tests/macros/tmacro1.nim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/macros/tmacro1.nim b/tests/macros/tmacro1.nim index ac2bf9094..5388e861c 100644 --- a/tests/macros/tmacro1.nim +++ b/tests/macros/tmacro1.nim @@ -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 ) |