diff options
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" + |