new tester; all tests categorized
This commit is contained in:
parent
51ee524109
commit
20b5f31c03
481 changed files with 794 additions and 2506 deletions
12
tests/macro/tmacrotypes.nim
Normal file
12
tests/macro/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