summary refs log tree commit diff stats
path: root/tests/template/tmodulealias.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/template/tmodulealias.nim')
-rw-r--r--tests/template/tmodulealias.nim19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/template/tmodulealias.nim b/tests/template/tmodulealias.nim
new file mode 100644
index 000000000..a7d155e51
--- /dev/null
+++ b/tests/template/tmodulealias.nim
@@ -0,0 +1,19 @@
+discard """
+  disabled: true
+"""
+
+when defined(windows):
+  import winlean
+else:
+  import posix
+
+when defined(Windows):
+  template orig: expr = 
+    winlean
+else:
+  template orig: expr = 
+    posix
+
+proc socket(domain, typ, protocol: int): int =
+  result = orig.socket(ord(domain), ord(typ), ord(protocol)))
+