Don't inspect typedescs
This commit is contained in:
parent
4fc9dabd58
commit
c9616897f0
2 changed files with 12 additions and 6 deletions
|
|
@ -157,6 +157,7 @@ macro check*(conditions: stmt): stmt {.immediate.} =
|
||||||
# Ident !"v"
|
# Ident !"v"
|
||||||
# IntLit 2
|
# IntLit 2
|
||||||
paramAst = exp[i][1]
|
paramAst = exp[i][1]
|
||||||
|
if exp[i].typekind notin {ntyTypeDesc}:
|
||||||
argsAsgns.add getAst(asgn(arg, paramAst))
|
argsAsgns.add getAst(asgn(arg, paramAst))
|
||||||
argsPrintOuts.add getAst(print(argStr, arg))
|
argsPrintOuts.add getAst(print(argStr, arg))
|
||||||
if exp[i].kind != nnkExprEqExpr:
|
if exp[i].kind != nnkExprEqExpr:
|
||||||
|
|
|
||||||
5
tests/stdlib/tunittest.nim
Normal file
5
tests/stdlib/tunittest.nim
Normal file
|
|
@ -0,0 +1,5 @@
|
||||||
|
import unittest
|
||||||
|
import options
|
||||||
|
test "unittest typedescs":
|
||||||
|
check(none(int) == none(int))
|
||||||
|
check(none(int) != some(1))
|
||||||
Loading…
Add table
Add a link
Reference in a new issue