summary refs log tree commit diff stats
path: root/tests/run
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2012-09-12 21:48:37 +0200
committerAraq <rumpf_a@web.de>2012-09-12 21:48:37 +0200
commita59abdf8e4d0c85fbcf2b039c46dc98030ffc460 (patch)
tree5e4eeb69d3fe050833f3abf7d398de9034a3faa2 /tests/run
parent8178cd4fab0968c1d808b6d3cf56c30c3db7fb37 (diff)
downloadNim-a59abdf8e4d0c85fbcf2b039c46dc98030ffc460.tar.gz
made more tests green; fixes #201
Diffstat (limited to 'tests/run')
-rw-r--r--tests/run/tgensym.nim16
-rwxr-xr-xtests/run/tmacro3.nim4
-rwxr-xr-xtests/run/tmacro4.nim2
-rwxr-xr-xtests/run/tmacros1.nim2
-rwxr-xr-xtests/run/tsets2.nim2
5 files changed, 21 insertions, 5 deletions
diff --git a/tests/run/tgensym.nim b/tests/run/tgensym.nim
new file mode 100644
index 000000000..3c85b0b83
--- /dev/null
+++ b/tests/run/tgensym.nim
@@ -0,0 +1,16 @@
+discard """
+  output: "123100"
+"""
+
+template hygienic(val: expr) =
+  var x = val
+  stdout.write x
+
+var x = 100
+
+hygienic 1
+hygienic 2
+hygienic 3
+
+echo x
+
diff --git a/tests/run/tmacro3.nim b/tests/run/tmacro3.nim
index fa2040e92..162212326 100755
--- a/tests/run/tmacro3.nim
+++ b/tests/run/tmacro3.nim
@@ -8,7 +8,7 @@ type
     TA = tuple[a: int]
     PA = ref TA
 
-macro test*(a: stmt): stmt =
+macro test*(a: stmt): stmt {.immediate.} =
   var val: PA
   new(val)
   val.a = 4
@@ -16,7 +16,7 @@ macro test*(a: stmt): stmt =
 test:
   "hi"
 
-macro test2*(a: stmt): stmt =
+macro test2*(a: stmt): stmt {.immediate.} =
   proc testproc(recurse: int) =
     echo "Thats weird"
     var o : PNimrodNode = nil
diff --git a/tests/run/tmacro4.nim b/tests/run/tmacro4.nim
index f90a8a434..10a23b159 100755
--- a/tests/run/tmacro4.nim
+++ b/tests/run/tmacro4.nim
@@ -5,7 +5,7 @@ discard """
 import
   macros, strutils
 
-macro test_macro*(n: stmt): stmt =
+macro test_macro*(n: stmt): stmt {.immediate.} =
   result = newNimNode(nnkStmtList)
   var ass : PNimrodNode = newNimNode(nnkAsgn)
   add(ass, newIdentNode("str"))
diff --git a/tests/run/tmacros1.nim b/tests/run/tmacros1.nim
index a1bb29823..b2fb7240d 100755
--- a/tests/run/tmacros1.nim
+++ b/tests/run/tmacros1.nim
@@ -5,7 +5,7 @@ discard """
 import
   macros, strutils
 
-macro outterMacro*(n: stmt): stmt =
+macro outterMacro*(n: stmt): stmt {.immediate.} =
   let n = callsite()
   var j : string = "hi"
   proc innerProc(i: int): string =
diff --git a/tests/run/tsets2.nim b/tests/run/tsets2.nim
index 89935072f..ac977096b 100755
--- a/tests/run/tsets2.nim
+++ b/tests/run/tsets2.nim
@@ -1,6 +1,6 @@
 discard """
   output: '''true'''
-  cmd: "nimrod cc --gc:none --hints:on $# $#"
+  cmd: "nimrod cc --hints:on $# $#"
 """
 
 import hashes, sets