diff options
author | Arne Döring <arne.doering@gmx.net> | 2018-10-18 17:49:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-18 17:49:47 +0200 |
commit | 9f18a4f4486d8eb7efd28f51c32d7b2f8c3018fa (patch) | |
tree | 11645859c8f628fa6284d58c0772d7fb927319df /tests | |
parent | 604dfebee0febc2244163069cf7583e005c7c9df (diff) | |
parent | f9bc4d014a84ae0aad7b174e6987451e6204caa7 (diff) | |
download | Nim-9f18a4f4486d8eb7efd28f51c32d7b2f8c3018fa.tar.gz |
Merge pull request #8366 from krux02/nimnode-or
or on NimNode
Diffstat (limited to 'tests')
-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 ) |