mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 06:20:38 +00:00
Don't inspect typedescs
This commit is contained in:
@@ -157,12 +157,13 @@ macro check*(conditions: stmt): stmt {.immediate.} =
|
||||
# Ident !"v"
|
||||
# IntLit 2
|
||||
paramAst = exp[i][1]
|
||||
argsAsgns.add getAst(asgn(arg, paramAst))
|
||||
argsPrintOuts.add getAst(print(argStr, arg))
|
||||
if exp[i].kind != nnkExprEqExpr:
|
||||
exp[i] = arg
|
||||
else:
|
||||
exp[i][1] = arg
|
||||
if exp[i].typekind notin {ntyTypeDesc}:
|
||||
argsAsgns.add getAst(asgn(arg, paramAst))
|
||||
argsPrintOuts.add getAst(print(argStr, arg))
|
||||
if exp[i].kind != nnkExprEqExpr:
|
||||
exp[i] = arg
|
||||
else:
|
||||
exp[i][1] = arg
|
||||
|
||||
case checked.kind
|
||||
of nnkCallKinds:
|
||||
|
||||
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))
|
||||
Reference in New Issue
Block a user