summary refs log tree commit diff stats
path: root/tests/modules
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-01-13 02:10:03 +0100
committerAraq <rumpf_a@web.de>2014-01-13 02:10:03 +0100
commit20b5f31c03fb556ec0aa2428a40adbac004d8987 (patch)
tree58086941e7d6bb8f480ca1173a95722ada9435b2 /tests/modules
parent51ee524109cf7e3e86c676bc1676063a01bfd979 (diff)
downloadNim-20b5f31c03fb556ec0aa2428a40adbac004d8987.tar.gz
new tester; all tests categorized
Diffstat (limited to 'tests/modules')
-rw-r--r--tests/modules/mexporta.nim8
-rw-r--r--tests/modules/mexportb.nim7
-rw-r--r--tests/modules/texport.nim10
-rw-r--r--tests/modules/timportexcept.nim10
4 files changed, 35 insertions, 0 deletions
diff --git a/tests/modules/mexporta.nim b/tests/modules/mexporta.nim
new file mode 100644
index 000000000..b7d4ddec9
--- /dev/null
+++ b/tests/modules/mexporta.nim
@@ -0,0 +1,8 @@
+# module A
+import mexportb
+export mexportb.TMyObject, mexportb.xyz
+
+export mexportb.q
+
+proc `$`*(x: TMyObject): string = "my object"
+
diff --git a/tests/modules/mexportb.nim b/tests/modules/mexportb.nim
new file mode 100644
index 000000000..10d89f388
--- /dev/null
+++ b/tests/modules/mexportb.nim
@@ -0,0 +1,7 @@
+# module B
+type TMyObject* = object
+
+const xyz* = 13
+
+proc q*(x: int): int = 6
+proc q*(x: string): string = "8"
diff --git a/tests/modules/texport.nim b/tests/modules/texport.nim
new file mode 100644
index 000000000..99228dfce
--- /dev/null
+++ b/tests/modules/texport.nim
@@ -0,0 +1,10 @@
+discard """
+  output: "my object68"
+"""
+
+import mexporta
+
+# B.TMyObject has been imported implicitly here: 
+var x: TMyObject
+echo($x, q(0), q"0")
+
diff --git a/tests/modules/timportexcept.nim b/tests/modules/timportexcept.nim
new file mode 100644
index 000000000..93a7fd642
--- /dev/null
+++ b/tests/modules/timportexcept.nim
@@ -0,0 +1,10 @@
+discard """
+  line: 9
+  errormsg: "undeclared identifier: '%'"
+"""
+
+import strutils except `%`
+
+# doesn't work
+echo "$1" % "abc"
+