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

View file

@ -0,0 +1,28 @@
discard """
output: "Sortable\nSortable\nContainer"
"""
import typetraits
type
TObj = object
x: int
Sortable = generic x, y
(x < y) is bool
ObjectContainer = generic C
C.len is ordinal
for v in items(C):
v.type is tuple|object
proc foo(c: ObjectContainer) =
echo "Container"
proc foo(x: Sortable) =
echo "Sortable"
foo 10
foo "test"
foo(@[TObj(x: 10), TObj(x: 20)])