summary refs log tree commit diff stats
path: root/tests/manyloc
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-07-05 15:51:04 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-07-05 15:51:04 +0200
commit0926754e68861947c67986bc9c7e0a011a58267b (patch)
treebc11469a33f1aabd202e7105177553688439712a /tests/manyloc
parent9b31f6785947974e89d46bbc0dee11f1c78754dc (diff)
downloadNim-0926754e68861947c67986bc9c7e0a011a58267b.tar.gz
make tests green again
Diffstat (limited to 'tests/manyloc')
-rw-r--r--tests/manyloc/keineschweine/lib/map_filter.nim6
-rw-r--r--tests/manyloc/keineschweine/lib/sg_gui.nim4
-rw-r--r--tests/manyloc/nake/nake.nim6
-rw-r--r--tests/manyloc/standalone/panicoverride.nim4
4 files changed, 12 insertions, 8 deletions
diff --git a/tests/manyloc/keineschweine/lib/map_filter.nim b/tests/manyloc/keineschweine/lib/map_filter.nim
index 42ef74ceb..f3f1df190 100644
--- a/tests/manyloc/keineschweine/lib/map_filter.nim
+++ b/tests/manyloc/keineschweine/lib/map_filter.nim
@@ -1,4 +1,4 @@
-template filterIt2*(seq, pred: expr, body: stmt): stmt {.immediate, dirty.} =
+template filterIt2*(seq, pred: untyped, body: untyped) =
   ## sequtils defines a filterIt() that returns a new seq, but this one is called
   ## with a statement body to iterate directly over it
   for it in items(seq):
@@ -13,8 +13,8 @@ proc mapInPlace*[A](x: var seq[A], fun: proc(y: A): A {.closure.}) =
   for i in 0..x.len-1:
     x[i] = fun(x[i])
 
-template unless*(condition: expr; body: stmt): stmt {.dirty.} =
-  if not(condition):
+template unless*(condition: untyped; body: untyped) {.dirty.} =
+  if not condition:
     body
 
 when isMainModule:
diff --git a/tests/manyloc/keineschweine/lib/sg_gui.nim b/tests/manyloc/keineschweine/lib/sg_gui.nim
index b7448d9df..95cef1b24 100644
--- a/tests/manyloc/keineschweine/lib/sg_gui.nim
+++ b/tests/manyloc/keineschweine/lib/sg_gui.nim
@@ -5,13 +5,13 @@ from strutils import countlines
 
 type
   PGuiContainer* = ref TGuiContainer
-  TGuiContainer* = object of TObject
+  TGuiContainer* = object of RootObj
     position: TVector2f
     activeEntry: PTextEntry
     widgets: seq[PGuiObject]
     buttons: seq[PButton]
   PGuiObject* = ref TGuiObject
-  TGuiObject* = object of TObject
+  TGuiObject* = object of RootObj
   PButton* = ref TButton
   TButton* = object of TGuiObject
     enabled: bool
diff --git a/tests/manyloc/nake/nake.nim b/tests/manyloc/nake/nake.nim
index 728619e47..fc871cb80 100644
--- a/tests/manyloc/nake/nake.nim
+++ b/tests/manyloc/nake/nake.nim
@@ -22,10 +22,10 @@ proc runTask*(name: string) {.inline.}
 proc shell*(cmd: varargs[string, `$`]): int {.discardable.}
 proc cd*(dir: string) {.inline.}
 
-template nakeImports*(): stmt {.immediate.} =
+template nakeImports*() =
   import tables, parseopt, strutils, os
 
-template task*(name: string; description: string; body: stmt): stmt {.dirty, immediate.} =
+template task*(name: string; description: string; body: untyped) {.dirty.} =
   block:
     var t = newTask(description, proc() {.closure.} =
       body)
@@ -40,7 +40,7 @@ proc runTask*(name: string) = tasks[name].action()
 proc shell*(cmd: varargs[string, `$`]): int =
   result = execShellCmd(cmd.join(" "))
 proc cd*(dir: string) = setCurrentDir(dir)
-template withDir*(dir: string; body: stmt): stmt =
+template withDir*(dir: string; body: untyped) =
   ## temporary cd
   ## withDir "foo":
   ##   # inside foo
diff --git a/tests/manyloc/standalone/panicoverride.nim b/tests/manyloc/standalone/panicoverride.nim
index d9b3f4388..9d0d070c7 100644
--- a/tests/manyloc/standalone/panicoverride.nim
+++ b/tests/manyloc/standalone/panicoverride.nim
@@ -2,6 +2,10 @@
 proc printf(frmt: cstring) {.varargs, importc, header: "<stdio.h>", cdecl.}
 proc exit(code: int) {.importc, header: "<stdlib.h>", cdecl.}
 
+proc nimToCStringConv(s: NimString): cstring {.compilerProc, inline.} =
+  if s == nil or s.len == 0: result = cstring""
+  else: result = cstring(addr s.data)
+
 {.push stack_trace: off, profiler:off.}
 
 proc rawoutput(s: string) =