summary refs log tree commit diff stats
path: root/tests/run/uexpr.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run/uexpr.nim')
-rw-r--r--tests/run/uexpr.nim13
1 files changed, 13 insertions, 0 deletions
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"
+