new tester; all tests categorized

This commit is contained in:
Araq 2014-01-13 02:10:03 +01:00
commit 20b5f31c03
481 changed files with 794 additions and 2506 deletions

33
tests/typerel/tvoid.nim Normal file
View file

@ -0,0 +1,33 @@
discard """
output: "he, no return type;abc a string"
"""
proc ReturnT[T](x: T): T =
when T is void:
echo "he, no return type;"
else:
result = x & " a string"
proc nothing(x, y: void): void =
echo "ha"
proc callProc[T](p: proc (x: T) {.nimcall.}, x: T) =
when T is void:
p()
else:
p(x)
proc intProc(x: int) =
echo x
proc emptyProc() =
echo "empty"
callProc[int](intProc, 12)
callProc[void](emptyProc)
ReturnT[void]()
echo ReturnT[string]("abc")
nothing()