better tester
This commit is contained in:
parent
12247b3f56
commit
383fbca27e
21 changed files with 39 additions and 31 deletions
12
tests/macros/tmacrotypes.nim
Normal file
12
tests/macros/tmacrotypes.nim
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import macros, typetraits
|
||||
|
||||
macro checkType(ex, expected: expr): stmt {.immediate.} =
|
||||
var t = ex.typ
|
||||
assert t.name == expected.strVal
|
||||
|
||||
proc voidProc = echo "hello"
|
||||
proc intProc(a, b): int = 10
|
||||
|
||||
checkType(voidProc(), "void")
|
||||
checkType(intProc(10, 20.0), "int")
|
||||
checkType(noproc(10, 20.0), "Error Type")
|
||||
Loading…
Add table
Add a link
Reference in a new issue