diff options
author | Zahary Karadjov <zahary@gmail.com> | 2012-03-21 23:48:03 +0200 |
---|---|---|
committer | Zahary Karadjov <zahary@gmail.com> | 2012-03-22 03:27:00 +0200 |
commit | 3a5cf3d63a5f31809acf5c5f07d6f6a33c19af3d (patch) | |
tree | 4d8b1775a047536d3c01cf78ee842d15c58233cd /tests | |
parent | 4f22326b2493642c1edb39ab262f1f7d0e81461c (diff) | |
download | Nim-3a5cf3d63a5f31809acf5c5f07d6f6a33c19af3d.tar.gz |
expr params implemented for procs; paving the way for type classes
Diffstat (limited to 'tests')
-rw-r--r-- | tests/run/tunittests.nim | 2 | ||||
-rw-r--r-- | tests/run/uexpr.nim | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/tests/run/tunittests.nim b/tests/run/tunittests.nim index b2ec10cdc..e64008e0c 100644 --- a/tests/run/tunittests.nim +++ b/tests/run/tunittests.nim @@ -1,2 +1,2 @@ -import uclosures, utemplates +import uclosures, utemplates, uexpr diff --git a/tests/run/uexpr.nim b/tests/run/uexpr.nim new file mode 100644 index 000000000..06bab375e --- /dev/null +++ b/tests/run/uexpr.nim @@ -0,0 +1,13 @@ +import unittest + +proc concat(a, b): string = + result = $a & $b + +test "if proc param types are not supplied, the params are assumed to be generic": + check concat(1, "test") == "1test" + check concat(1, 20) == "120" + check concat("foo", "bar") == "foobar" + +test "explicit param types can still be specified": + check concat[cstring, cstring]("x", "y") == "xy" + |