diff options
Diffstat (limited to 'tests/modules')
-rw-r--r-- | tests/modules/definitions.nim | 4 | ||||
-rw-r--r-- | tests/modules/proxy_module.nim | 3 | ||||
-rw-r--r-- | tests/modules/tcanimport.nim | 19 |
3 files changed, 26 insertions, 0 deletions
diff --git a/tests/modules/definitions.nim b/tests/modules/definitions.nim new file mode 100644 index 000000000..edc6eaa6d --- /dev/null +++ b/tests/modules/definitions.nim @@ -0,0 +1,4 @@ +var v*: int +proc p* = echo "proc p called" +template t* = echo "template t expanded" + diff --git a/tests/modules/proxy_module.nim b/tests/modules/proxy_module.nim new file mode 100644 index 000000000..c244688cd --- /dev/null +++ b/tests/modules/proxy_module.nim @@ -0,0 +1,3 @@ +import definitions +export definitions except p + diff --git a/tests/modules/tcanimport.nim b/tests/modules/tcanimport.nim new file mode 100644 index 000000000..bc4e2e53f --- /dev/null +++ b/tests/modules/tcanimport.nim @@ -0,0 +1,19 @@ +discard """ + output: '''ABC +nope''' +""" + +template canImport(x): bool = + compiles: + import x + +when canImport(strutils): + import strutils + echo "abc".toUpperAscii +else: + echo "meh" + +when canImport(none): + echo "what" +else: + echo "nope" |