diff --git a/koch.nim b/koch.nim
index 1b5c96b23..22e30ac5e 100644
--- a/koch.nim
+++ b/koch.nim
@@ -1,7 +1,7 @@
#
#
# Maintenance program for Nimrod
-# (c) Copyright 2013 Andreas Rumpf
+# (c) Copyright 2014 Andreas Rumpf
#
# See the file "copying.txt", included in this
# distribution, for details about the copyright.
@@ -26,7 +26,7 @@ const
+-----------------------------------------------------------------+
| Maintenance program for Nimrod |
| Version $1|
-| (c) 2013 Andreas Rumpf |
+| (c) 2014 Andreas Rumpf |
+-----------------------------------------------------------------+
Build time: $2, $3
@@ -268,6 +268,11 @@ proc tests(args: string) =
exec(getCurrentDir() / "tests/tester".exe & " compile")
exec(getCurrentDir() / "tests/tester".exe & " run")
exec(getCurrentDir() / "tests/tester".exe & " merge")
+ when false:
+ # activate real soon:
+ exec("nimrod cc --taintMode:on tests/testament/tester")
+ exec(getCurrentDir() / "tests/testament/tester".exe & " all")
+
proc temp(args: string) =
var output = "compiler" / "nimrod".exe
diff --git a/tests/run/tactiontable.nim b/tests/actiontable/tactiontable.nim
similarity index 100%
rename from tests/run/tactiontable.nim
rename to tests/actiontable/tactiontable.nim
diff --git a/tests/reject/tactiontable2.nim b/tests/actiontable/tactiontable2.nim
similarity index 100%
rename from tests/reject/tactiontable2.nim
rename to tests/actiontable/tactiontable2.nim
diff --git a/tests/compile/talias.nim b/tests/alias/talias.nim
similarity index 100%
rename from tests/compile/talias.nim
rename to tests/alias/talias.nim
diff --git a/tests/reject/mambsym1.nim b/tests/ambsym/mambsym1.nim
similarity index 100%
rename from tests/reject/mambsym1.nim
rename to tests/ambsym/mambsym1.nim
diff --git a/tests/reject/mambsym2.nim b/tests/ambsym/mambsym2.nim
similarity index 100%
rename from tests/reject/mambsym2.nim
rename to tests/ambsym/mambsym2.nim
diff --git a/tests/run/mambsys1.nim b/tests/ambsym/mambsys1.nim
similarity index 100%
rename from tests/run/mambsys1.nim
rename to tests/ambsym/mambsys1.nim
diff --git a/tests/run/mambsys2.nim b/tests/ambsym/mambsys2.nim
similarity index 100%
rename from tests/run/mambsys2.nim
rename to tests/ambsym/mambsys2.nim
diff --git a/tests/reject/tambsym.nim b/tests/ambsym/tambsym.nim
similarity index 100%
rename from tests/reject/tambsym.nim
rename to tests/ambsym/tambsym.nim
diff --git a/tests/run/tambsym2.nim b/tests/ambsym/tambsym2.nim
similarity index 100%
rename from tests/run/tambsym2.nim
rename to tests/ambsym/tambsym2.nim
diff --git a/tests/reject/tambsym3.nim b/tests/ambsym/tambsym3.nim
similarity index 100%
rename from tests/reject/tambsym3.nim
rename to tests/ambsym/tambsym3.nim
diff --git a/tests/run/tambsys.nim b/tests/ambsym/tambsys.nim
similarity index 100%
rename from tests/run/tambsys.nim
rename to tests/ambsym/tambsys.nim
diff --git a/tests/run/tarray.nim b/tests/array/tarray.nim
similarity index 100%
rename from tests/run/tarray.nim
rename to tests/array/tarray.nim
diff --git a/tests/run/tarray2.nim b/tests/array/tarray2.nim
similarity index 100%
rename from tests/run/tarray2.nim
rename to tests/array/tarray2.nim
diff --git a/tests/run/tarray3.nim b/tests/array/tarray3.nim
similarity index 100%
rename from tests/run/tarray3.nim
rename to tests/array/tarray3.nim
diff --git a/tests/reject/tarraycons.nim b/tests/array/tarraycons.nim
similarity index 100%
rename from tests/reject/tarraycons.nim
rename to tests/array/tarraycons.nim
diff --git a/tests/run/tarraycons.nim b/tests/array/tarraycons2.nim
similarity index 100%
rename from tests/run/tarraycons.nim
rename to tests/array/tarraycons2.nim
diff --git a/tests/reject/tarrayplus.nim b/tests/array/tarrayplus.nim
similarity index 100%
rename from tests/reject/tarrayplus.nim
rename to tests/array/tarrayplus.nim
diff --git a/tests/compile/tarrindx.nim b/tests/array/tarrindx.nim
similarity index 100%
rename from tests/compile/tarrindx.nim
rename to tests/array/tarrindx.nim
diff --git a/tests/run/tassert.nim b/tests/assert/tassert.nim
similarity index 100%
rename from tests/run/tassert.nim
rename to tests/assert/tassert.nim
diff --git a/tests/run/tfailedassert.nim b/tests/assert/tfailedassert.nim
similarity index 100%
rename from tests/run/tfailedassert.nim
rename to tests/assert/tfailedassert.nim
diff --git a/tests/run/tunittests.nim b/tests/assert/tunittests.nim
similarity index 100%
rename from tests/run/tunittests.nim
rename to tests/assert/tunittests.nim
diff --git a/tests/run/tuserassert.nim b/tests/assert/tuserassert.nim
similarity index 100%
rename from tests/run/tuserassert.nim
rename to tests/assert/tuserassert.nim
diff --git a/tests/compile/tassign.nim b/tests/assign/tassign.nim
similarity index 100%
rename from tests/compile/tassign.nim
rename to tests/assign/tassign.nim
diff --git a/tests/run/tcopy.nim b/tests/assign/tcopy.nim
similarity index 100%
rename from tests/run/tcopy.nim
rename to tests/assign/tcopy.nim
diff --git a/tests/run/tgenericassign.nim b/tests/assign/tgenericassign.nim
similarity index 100%
rename from tests/run/tgenericassign.nim
rename to tests/assign/tgenericassign.nim
diff --git a/tests/run/tgenericassigntuples.nim b/tests/assign/tgenericassigntuples.nim
similarity index 100%
rename from tests/run/tgenericassigntuples.nim
rename to tests/assign/tgenericassigntuples.nim
diff --git a/tests/run/tobjasgn.nim b/tests/assign/tobjasgn.nim
similarity index 100%
rename from tests/run/tobjasgn.nim
rename to tests/assign/tobjasgn.nim
diff --git a/tests/run/tvariantasgn.nim b/tests/assign/tvariantasgn.nim
similarity index 100%
rename from tests/run/tvariantasgn.nim
rename to tests/assign/tvariantasgn.nim
diff --git a/tests/run/tastoverload1.nim b/tests/astoverload/tastoverload1.nim
similarity index 100%
rename from tests/run/tastoverload1.nim
rename to tests/astoverload/tastoverload1.nim
diff --git a/tests/run/tasynciossl.nim b/tests/async/tasynciossl.nim
similarity index 100%
rename from tests/run/tasynciossl.nim
rename to tests/async/tasynciossl.nim
diff --git a/tests/run/tasyncudp.nim b/tests/async/tasyncudp.nim
similarity index 100%
rename from tests/run/tasyncudp.nim
rename to tests/async/tasyncudp.nim
diff --git a/tests/run/mbind3.nim b/tests/bind/mbind3.nim
similarity index 100%
rename from tests/run/mbind3.nim
rename to tests/bind/mbind3.nim
diff --git a/tests/run/tbind1.nim b/tests/bind/tbind1.nim
similarity index 100%
rename from tests/run/tbind1.nim
rename to tests/bind/tbind1.nim
diff --git a/tests/reject/tbind2.nim b/tests/bind/tbind2.nim
similarity index 100%
rename from tests/reject/tbind2.nim
rename to tests/bind/tbind2.nim
diff --git a/tests/run/tbind3.nim b/tests/bind/tbind3.nim
similarity index 100%
rename from tests/run/tbind3.nim
rename to tests/bind/tbind3.nim
diff --git a/tests/compile/tbindoverload.nim b/tests/bind/tbindoverload.nim
similarity index 100%
rename from tests/compile/tbindoverload.nim
rename to tests/bind/tbindoverload.nim
diff --git a/tests/reject/tbindtypedesc.nim b/tests/bind/tbindtypedesc.nim
similarity index 100%
rename from tests/reject/tbindtypedesc.nim
rename to tests/bind/tbindtypedesc.nim
diff --git a/tests/compile/tdatabind.nim b/tests/bind/tdatabind.nim
similarity index 100%
rename from tests/compile/tdatabind.nim
rename to tests/bind/tdatabind.nim
diff --git a/tests/run/tmixin.nim b/tests/bind/tmixin.nim
similarity index 100%
rename from tests/run/tmixin.nim
rename to tests/bind/tmixin.nim
diff --git a/tests/reject/tnicerrorforsymchoice.nim b/tests/bind/tnicerrorforsymchoice.nim
similarity index 100%
rename from tests/reject/tnicerrorforsymchoice.nim
rename to tests/bind/tnicerrorforsymchoice.nim
diff --git a/tests/reject/tblock1.nim b/tests/block/tblock1.nim
similarity index 100%
rename from tests/reject/tblock1.nim
rename to tests/block/tblock1.nim
diff --git a/tests/run/tborrow.nim b/tests/borrow/tborrow.nim
similarity index 100%
rename from tests/run/tborrow.nim
rename to tests/borrow/tborrow.nim
diff --git a/tests/reject/tinvalidborrow.nim b/tests/borrow/tinvalidborrow.nim
similarity index 100%
rename from tests/reject/tinvalidborrow.nim
rename to tests/borrow/tinvalidborrow.nim
diff --git a/tests/run/tcase_setconstr.nim b/tests/casestmt/tcase_setconstr.nim
similarity index 100%
rename from tests/run/tcase_setconstr.nim
rename to tests/casestmt/tcase_setconstr.nim
diff --git a/tests/reject/tcaseexpr1.nim b/tests/casestmt/tcaseexpr1.nim
similarity index 100%
rename from tests/reject/tcaseexpr1.nim
rename to tests/casestmt/tcaseexpr1.nim
diff --git a/tests/reject/tcaseoverlaprange.nim b/tests/casestmt/tcaseoverlaprange.nim
similarity index 100%
rename from tests/reject/tcaseoverlaprange.nim
rename to tests/casestmt/tcaseoverlaprange.nim
diff --git a/tests/reject/tcaseoverlaprange2.nim b/tests/casestmt/tcaseoverlaprange2.nim
similarity index 100%
rename from tests/reject/tcaseoverlaprange2.nim
rename to tests/casestmt/tcaseoverlaprange2.nim
diff --git a/tests/run/tcasestm.nim b/tests/casestmt/tcasestm.nim
similarity index 100%
rename from tests/run/tcasestm.nim
rename to tests/casestmt/tcasestm.nim
diff --git a/tests/compile/tcomputedgoto.nim b/tests/casestmt/tcomputedgoto.nim
similarity index 100%
rename from tests/compile/tcomputedgoto.nim
rename to tests/casestmt/tcomputedgoto.nim
diff --git a/tests/compile/tlinearscanend.nim b/tests/casestmt/tlinearscanend.nim
similarity index 100%
rename from tests/compile/tlinearscanend.nim
rename to tests/casestmt/tlinearscanend.nim
diff --git a/tests/compile/tccgen1.nim b/tests/ccgbugs/tccgen1.nim
similarity index 100%
rename from tests/compile/tccgen1.nim
rename to tests/ccgbugs/tccgen1.nim
diff --git a/tests/run/tcgbug.nim b/tests/ccgbugs/tcgbug.nim
similarity index 100%
rename from tests/run/tcgbug.nim
rename to tests/ccgbugs/tcgbug.nim
diff --git a/tests/compile/tcodegenbug1.nim b/tests/ccgbugs/tcodegenbug1.nim
similarity index 100%
rename from tests/compile/tcodegenbug1.nim
rename to tests/ccgbugs/tcodegenbug1.nim
diff --git a/tests/run/tclosure.nim b/tests/closure/tclosure.nim
similarity index 100%
rename from tests/run/tclosure.nim
rename to tests/closure/tclosure.nim
diff --git a/tests/run/tclosure2.nim b/tests/closure/tclosure2.nim
similarity index 100%
rename from tests/run/tclosure2.nim
rename to tests/closure/tclosure2.nim
diff --git a/tests/run/tclosure3.nim b/tests/closure/tclosure3.nim
similarity index 100%
rename from tests/run/tclosure3.nim
rename to tests/closure/tclosure3.nim
diff --git a/tests/compile/tclosure4.nim b/tests/closure/tclosure4.nim
similarity index 100%
rename from tests/compile/tclosure4.nim
rename to tests/closure/tclosure4.nim
diff --git a/tests/compile/tclosurebug2.nim b/tests/closure/tclosurebug2.nim
similarity index 100%
rename from tests/compile/tclosurebug2.nim
rename to tests/closure/tclosurebug2.nim
diff --git a/tests/run/tinterf.nim b/tests/closure/tinterf.nim
similarity index 100%
rename from tests/run/tinterf.nim
rename to tests/closure/tinterf.nim
diff --git a/tests/reject/tinvalidclosure.nim b/tests/closure/tinvalidclosure.nim
similarity index 100%
rename from tests/reject/tinvalidclosure.nim
rename to tests/closure/tinvalidclosure.nim
diff --git a/tests/reject/tinvalidclosure2.nim b/tests/closure/tinvalidclosure2.nim
similarity index 100%
rename from tests/reject/tinvalidclosure2.nim
rename to tests/closure/tinvalidclosure2.nim
diff --git a/tests/compile/tnamedparamanonproc.nim b/tests/closure/tnamedparamanonproc.nim
similarity index 100%
rename from tests/compile/tnamedparamanonproc.nim
rename to tests/closure/tnamedparamanonproc.nim
diff --git a/tests/compile/tnestedproc.nim b/tests/closure/tnestedproc.nim
similarity index 100%
rename from tests/compile/tnestedproc.nim
rename to tests/closure/tnestedproc.nim
diff --git a/tests/run/uclosures.nim b/tests/closure/uclosures.nim
similarity index 100%
rename from tests/run/uclosures.nim
rename to tests/closure/uclosures.nim
diff --git a/tests/run/tcnstseq.nim b/tests/cnstseq/tcnstseq.nim
similarity index 100%
rename from tests/run/tcnstseq.nim
rename to tests/cnstseq/tcnstseq.nim
diff --git a/tests/run/tcnstseq2.nim b/tests/cnstseq/tcnstseq2.nim
similarity index 100%
rename from tests/run/tcnstseq2.nim
rename to tests/cnstseq/tcnstseq2.nim
diff --git a/tests/run/tcnstseq3.nim b/tests/cnstseq/tcnstseq3.nim
similarity index 100%
rename from tests/run/tcnstseq3.nim
rename to tests/cnstseq/tcnstseq3.nim
diff --git a/tests/compile/mvarious.nim b/tests/compile/mvarious.nim
deleted file mode 100644
index 333b34d33..000000000
--- a/tests/compile/mvarious.nim
+++ /dev/null
@@ -1,6 +0,0 @@
-# Test a submodule
-
-#type
-# TStringArr = array [0.. *] of string
-
-proc exportme* = nil
diff --git a/tests/compile/sunset.tmpl b/tests/compile/sunset.tmpl
deleted file mode 100644
index 6475bac4e..000000000
--- a/tests/compile/sunset.tmpl
+++ /dev/null
@@ -1,68 +0,0 @@
-#! stdtmpl
-#proc sunsetTemplate*(current, ticker, content: string,
-# tabs: openarray[array[0..1, string]]): string =
-# result = ""
-
-
-
-
-
-
-
-
-
Nimrod Programming System
-
-
-
-
-
-
-
- $content
-
-
-
-
-
-
diff --git a/tests/compile/tambsym2.nim b/tests/compile/tambsym2.nim
deleted file mode 100644
index 7758cc31a..000000000
--- a/tests/compile/tambsym2.nim
+++ /dev/null
@@ -1,6 +0,0 @@
-
-from sdl import PSurface
-
-discard SDL.CreateRGBSurface(SDL.SWSURFACE, 23, 34,
- 32, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xff000000'i32)
-
diff --git a/tests/compile/tcmdline.nim b/tests/compile/tcmdline.nim
deleted file mode 100644
index f4ee20d31..000000000
--- a/tests/compile/tcmdline.nim
+++ /dev/null
@@ -1,14 +0,0 @@
-# Test the command line
-
-import
- os, strutils
-
-var
- i: int
- params = paramCount()
-i = 0
-writeln(stdout, "This exe: " & getAppFilename())
-writeln(stdout, "Number of parameters: " & $params)
-while i <= params:
- writeln(stdout, paramStr(i))
- i = i + 1
diff --git a/tests/compile/tcolonisproc.nim b/tests/compile/tcolonisproc.nim
deleted file mode 100644
index e55587dfc..000000000
--- a/tests/compile/tcolonisproc.nim
+++ /dev/null
@@ -1,12 +0,0 @@
-
-proc p(a, b: int, c: proc ()) =
- c()
-
-
-p(1, 3):
- echo 1
- echo 3
-
-p(1, 1, proc() =
- echo 1
- echo 2)
diff --git a/tests/compile/tdllvar.nim b/tests/compile/tdllvar.nim
deleted file mode 100644
index ab767770c..000000000
--- a/tests/compile/tdllvar.nim
+++ /dev/null
@@ -1,16 +0,0 @@
-import os
-
-proc getDllName: string =
- result = "mylib.dll"
- if ExistsFile(result): return
- result = "mylib2.dll"
- if ExistsFile(result): return
- quit("could not load dynamic library")
-
-proc myImport(s: cstring) {.cdecl, importc, dynlib: getDllName().}
-proc myImport2(s: int) {.cdecl, importc, dynlib: getDllName().}
-
-myImport("test2")
-myImport2(12)
-
-
diff --git a/tests/compile/temptyecho.nim b/tests/compile/temptyecho.nim
deleted file mode 100644
index 5f1aa6515..000000000
--- a/tests/compile/temptyecho.nim
+++ /dev/null
@@ -1,2 +0,0 @@
-echo()
-
diff --git a/tests/compile/tendian.nim b/tests/compile/tendian.nim
deleted file mode 100644
index 256e2653c..000000000
--- a/tests/compile/tendian.nim
+++ /dev/null
@@ -1,3 +0,0 @@
-# test the new endian magic
-
-writeln(stdout, repr(system.cpuEndian))
diff --git a/tests/compile/tfib.nim b/tests/compile/tfib.nim
deleted file mode 100644
index 09a4d5038..000000000
--- a/tests/compile/tfib.nim
+++ /dev/null
@@ -1,11 +0,0 @@
-
-iterator fibonacci(): int =
- var a = 0
- var b = 1
- while true:
- yield a
- var c = b
- b = a
- a = a + c
-
-
diff --git a/tests/compile/tgetstartmilsecs.nim b/tests/compile/tgetstartmilsecs.nim
deleted file mode 100644
index 5a3368e0f..000000000
--- a/tests/compile/tgetstartmilsecs.nim
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-import times, os
-
-var start = epochTime()
-os.sleep(1000)
-
-echo epochTime() - start #OUT 1000
diff --git a/tests/compile/tgtk.nim b/tests/compile/tgtk.nim
deleted file mode 100644
index 7febb0ab8..000000000
--- a/tests/compile/tgtk.nim
+++ /dev/null
@@ -1,51 +0,0 @@
-
-import
- gtk2, glib2, atk, gdk2, gdk2pixbuf, libglade2, pango,
- pangoutils
-
-proc hello(widget: PWidget, data: pointer) {.cdecl.} =
- write(stdout, "Hello World\n")
-
-proc delete_event(widget: PWidget, event: PEvent,
- data: pointer): bool {.cdecl.} =
- # If you return FALSE in the "delete_event" signal handler,
- # GTK will emit the "destroy" signal. Returning TRUE means
- # you don't want the window to be destroyed.
- # This is useful for popping up 'are you sure you want to quit?'
- # type dialogs.
- write(stdout, "delete event occurred\n")
- # Change TRUE to FALSE and the main window will be destroyed with
- # a "delete_event".
- return false
-
-# Another callback
-proc mydestroy(widget: PWidget, data: pointer) {.cdecl.} =
- gtk2.main_quit()
-
-proc mymain() =
- # GtkWidget is the storage type for widgets
- gtk2.nimrod_init()
- var window = window_new(gtk2.WINDOW_TOPLEVEL)
- discard g_signal_connect(window, "delete_event",
- Gcallback(delete_event), nil)
- discard g_signal_connect(window, "destroy", Gcallback(mydestroy), nil)
- # Sets the border width of the window.
- set_border_width(window, 10)
-
- # Creates a new button with the label "Hello World".
- var button = button_new("Hello World")
-
- discard g_signal_connect(button, "clicked", Gcallback(hello), nil)
-
- # This packs the button into the window (a gtk container).
- add(window, button)
-
- # The final step is to display this newly created widget.
- show(button)
-
- # and the window
- show(window)
-
- gtk2.main()
-
-mymain()
diff --git a/tests/compile/thallo.nim b/tests/compile/thallo.nim
deleted file mode 100644
index 7244c27a1..000000000
--- a/tests/compile/thallo.nim
+++ /dev/null
@@ -1,85 +0,0 @@
-# Hallo
-
-import
- os, strutils, macros
-
-type
- TMyEnum = enum
- meA, meB, meC, meD
-
-when isMainModule:
- {.hint: "this is the main file".}
-
-proc fac[T](x: T): T =
- # test recursive generic procs
- if x <= 1: return 1
- else: return x.`*`(fac(x-1))
-
-macro macrotest(n: expr): stmt {.immediate.} =
- let n = callsite()
- expectKind(n, nnkCall)
- expectMinLen(n, 2)
- result = newNimNode(nnkStmtList, n)
- for i in 2..n.len-1:
- result.add(newCall("write", n[1], n[i]))
- result.add(newCall("writeln", n[1], newStrLitNode("")))
-
-macro debug(n: expr): stmt {.immediate.} =
- let n = callsite()
- result = newNimNode(nnkStmtList, n)
- for i in 1..n.len-1:
- result.add(newCall("write", newIdentNode("stdout"), toStrLit(n[i])))
- result.add(newCall("write", newIdentNode("stdout"), newStrLitNode(": ")))
- result.add(newCall("writeln", newIdentNode("stdout"), n[i]))
-
-macrotest(stdout, "finally", 4, 5, "variable", "argument lists")
-macrotest(stdout)
-
-#GC_disable()
-
-echo("This was compiled by Nimrod version " & system.nimrodVersion)
-writeln(stdout, "Hello", " World", "!")
-
-echo(["a", "b", "c", "d"].len)
-for x in items(["What's", "your", "name", "?", ]):
- echo(x)
-var `name` = readLine(stdin)
-{.breakpoint.}
-echo("Hi " & thallo.name & "!\n")
-debug(name)
-
-var testseq: seq[string] = @[
- "a", "b", "c", "d", "e"
-]
-echo(repr(testseq))
-
-var dummy = "hello"
-echo(substr(dummy, 2, 3))
-
-echo($meC)
-
-# test tuples:
-for x, y in items([(1, 2), (3, 4), (6, 1), (5, 2)]):
- echo x
- echo y
-
-proc simpleConst(): int = return 34
-
-# test constant evaluation:
-const
- constEval3 = simpleConst()
- constEval = "abc".contains('b')
- constEval2 = fac(7)
-
-echo(constEval3)
-echo(constEval)
-echo(constEval2)
-echo(1.`+`(2))
-
-for i in 2..6:
- for j in countdown(i+4, 2):
- echo(fac(i * j))
-
-when isMainModule:
- {.hint: "this is the main file".}
-
diff --git a/tests/compile/theaproots.nim b/tests/compile/theaproots.nim
deleted file mode 100644
index aec140f42..000000000
--- a/tests/compile/theaproots.nim
+++ /dev/null
@@ -1,71 +0,0 @@
-type
- Bar = object
- x: int
-
- Foo = object
- rheap: ref Bar
- rmaybe: ref Bar
- rstack: ref Bar
- list: seq[ref Bar]
- listarr: array[0..5, ref Bar]
- nestedtup: Tup
- inner: TInner
- inref: ref TInner
-
- TInner = object
- inref: ref Bar
-
- Tup = tuple
- tupbar: ref Bar
- inner: TInner
-
-proc acc(x: var Foo): var ref Bar =
- result = x.rheap
-
-proc test(maybeFoo: var Foo,
- maybeSeq: var seq[ref Bar],
- bars: var openarray[ref Bar],
- maybeTup: var Tup) =
- var bb: ref Bar
- maybeFoo.rmaybe = bb
- maybeFoo.list[3] = bb
- maybeFoo.listarr[3] = bb
- acc(maybeFoo) = bb
-
- var localFoo: Foo
- localFoo.rstack = bb
- localFoo.list[3] = bb
- localFoo.listarr[3] = bb
- acc(localFoo) = bb
-
- var heapFoo: ref Foo
- heapFoo.rheap = bb
- heapFoo.list[3] = bb
- heapFoo.listarr[3] = bb
- acc(heapFoo[]) = bb
-
- heapFoo.nestedtup.tupbar = bb
- heapFoo.nestedtup.inner.inref = bb
- heapFoo.inner.inref = bb
- heapFoo.inref.inref = bb
-
- var locseq: seq[ref Bar]
- locseq[3] = bb
-
- var locarr: array[0..4, ref Bar]
- locarr[3] = bb
-
- maybeSeq[3] = bb
-
- bars[3] = bb
-
- maybeTup[0] = bb
-
-var
- ff: ref Foo
- tt: Tup
- gseq: seq[ref Bar]
-
-new(ff)
-
-test(ff[], gseq, gseq, tt)
diff --git a/tests/compile/tlastmod.nim b/tests/compile/tlastmod.nim
deleted file mode 100644
index 75b047fc8..000000000
--- a/tests/compile/tlastmod.nim
+++ /dev/null
@@ -1,18 +0,0 @@
-# test the new LastModificationTime() proc
-
-import
- os, times, strutils
-
-proc main() =
- var
- a, b: TTime
- a = getLastModificationTime(ParamStr(1))
- b = getLastModificationTime(ParamStr(2))
- writeln(stdout, $a)
- writeln(stdout, $b)
- if a < b:
- Write(stdout, "$2 is newer than $1\n" % [ParamStr(1), ParamStr(2)])
- else:
- Write(stdout, "$1 is newer than $2\n" % [ParamStr(1), ParamStr(2)])
-
-main()
diff --git a/tests/compile/tlibs.nim b/tests/compile/tlibs.nim
deleted file mode 100644
index 971b2b836..000000000
--- a/tests/compile/tlibs.nim
+++ /dev/null
@@ -1,24 +0,0 @@
-# Test wether the bindings at least compile...
-
-import
- unicode, cgi, terminal, libcurl,
- parsexml, parseopt, parsecfg,
- osproc, complex,
- sdl, smpeg, sdl_gfx, sdl_net, sdl_mixer, sdl_ttf,
- sdl_image, sdl_mixer_nosmpeg,
- cursorfont, xatom, xf86vmode, xkb, xrandr, xshm, xvlib, keysym, xcms, xi,
- xkblib, xrender, xutil, x, xf86dga, xinerama, xlib, xresource, xv,
- gtk2, glib2, pango, gdk2,
- cairowin32, cairoxlib,
- odbcsql,
- gl, glut, glu, glx, glext, wingl,
- lua, lualib, lauxlib, mysql, sqlite3, python, tcl,
- db_postgres, db_mysql, db_sqlite, ropes, sockets, browsers, httpserver,
- httpclient, parseutils, unidecode, xmldom, xmldomparser, xmltree, xmlparser,
- htmlparser, re, graphics, colors, pegs, subexes, dialogs
-
-when defined(linux):
- import
- zlib, zipfiles
-
-writeln(stdout, "test compilation of binding modules")
diff --git a/tests/compile/tloops.nim b/tests/compile/tloops.nim
deleted file mode 100644
index f6f939769..000000000
--- a/tests/compile/tloops.nim
+++ /dev/null
@@ -1,87 +0,0 @@
-# Test nested loops and some other things
-
-proc andTest() =
- var a = 0 == 5 and 6 == 6
-
-proc incx(x: var int) = # is built-in proc
- x = x + 1
-
-proc decx(x: var int) =
- x = x - 1
-
-proc First(y: var int) =
- var x: int
- i_ncx(x)
- if x == 10:
- y = 0
- else:
- if x == 0:
- incx(x)
- else:
- x=11
-
-proc TestLoops() =
- var i, j: int
- while i >= 0:
- if i mod 3 == 0:
- break
- i = i + 1
- while j == 13:
- j = 13
- break
- break
-
- while True:
- break
-
-
-proc Foo(n: int): int =
- var
- a, old: int
- b, c: bool
- F_irst(a)
- if a == 10:
- a = 30
- elif a == 11:
- a = 22
- elif a == 12:
- a = 23
- elif b:
- old = 12
- else:
- a = 40
-
- #
- b = false or 2 == 0 and 3 == 9
- a = 0 + 3 * 5 + 6 + 7 + +8 # 36
- while b:
- a = a + 3
- a = a + 5
- write(stdout, "Hello!")
-
-
-# We should come till here :-)
-discard Foo(345)
-
-# test the new type symbol lookup feature:
-
-type
- MyType[T] = tuple[
- x, y, z: T]
- MyType2 = tuple[x, y: float]
-
-proc main[T]() =
- var myType: MyType[T]
- var b: MyType[T]
- b = (1, 2, 3)
- myType = b
- echo myType
-
- var myType2: MyType2
- var c: MyType2
- c = (1.0, 2.0)
- myType2 = c
- echo myType2
-
-main[int]()
-
diff --git a/tests/compile/tmandelbrot.nim b/tests/compile/tmandelbrot.nim
deleted file mode 100644
index 1e39c8756..000000000
--- a/tests/compile/tmandelbrot.nim
+++ /dev/null
@@ -1,57 +0,0 @@
-discard """
- cmd: "nimrod cc --hints:on -d:release $# $#"
-"""
-
-# -*- nimrod -*-
-
-import math
-import os
-import strutils
-
-type TComplex = tuple[re, im: float]
-
-proc `+` (a, b: TComplex): TComplex =
- return (a.re + b.re, a.im + b.im)
-
-proc `*` (a, b: TComplex): TComplex =
- result.re = a.re * b.re - a.im * b.im
- result.im = a.re * b.im + a.im * b.re
-
-proc abs2 (a: TComplex): float =
- return a.re * a.re + a.im * a.im
-
-var size = parseInt (paramStr (1))
-var bit = 128
-var byteAcc = 0
-
-stdout.writeln ("P4")
-stdout.write ($size)
-stdout.write (" ")
-stdout.writeln ($size)
-
-var fsize = float (size)
-for y in 0 .. size-1:
- var fy = 2.0 * float (y) / fsize - 1.0
- for x in 0 .. size-1:
- var z = (0.0, 0.0)
- var c = (float (2*x) / fsize - 1.5, fy)
-
- block iter:
- for i in 0 .. 49:
- z = z*z + c
- if abs2 (z) >= 4.0:
- break iter
- byteAcc = byteAcc + bit
-
- if bit > 1:
- bit = bit div 2
- else:
- stdout.write (chr (byteAcc))
- bit = 128
- byteAcc = 0
-
- if bit != 128:
- stdout.write (chr (byteAcc))
- bit = 128
- byteAcc = 0
-
diff --git a/tests/compile/tnew.nim b/tests/compile/tnew.nim
deleted file mode 100644
index 6527541a2..000000000
--- a/tests/compile/tnew.nim
+++ /dev/null
@@ -1,49 +0,0 @@
-# Test the implementation of the new operator
-# and the code generation for gc walkers
-# (and the garbage collector):
-
-type
- PNode = ref TNode
- TNode = object
- data: int
- str: string
- le, ri: PNode
-
- TStressTest = ref array [0..45, array [1..45, TNode]]
-
-proc finalizer(n: PNode) =
- write(stdout, n.data)
- write(stdout, " is now freed\n")
-
-proc newNode(data: int, le, ri: PNode): PNode =
- new(result, finalizer)
- result.le = le
- result.ri = ri
- result.data = data
-
-# now loop and build a tree
-proc main() =
- var
- i = 0
- p: TStressTest
- while i < 1000:
- var n: PNode
-
- n = newNode(i, nil, newNode(i + 10000, nil, nil))
- inc(i)
- new(p)
-
- write(stdout, "Simple tree node allocation worked!\n")
- i = 0
- while i < 1000:
- var m = newNode(i + 20000, nil, nil)
- var k = newNode(i + 30000, nil, nil)
- m.le = m
- m.ri = k
- k.le = m
- k.ri = k
- inc(i)
-
- write(stdout, "Simple cycle allocation worked!\n")
-
-main()
diff --git a/tests/compile/tnewlibs.nim b/tests/compile/tnewlibs.nim
deleted file mode 100644
index bdb53ae0b..000000000
--- a/tests/compile/tnewlibs.nim
+++ /dev/null
@@ -1,17 +0,0 @@
-# Test wether the bindings at least compile...
-
-import
- tcl,
- sdl, smpeg, sdl_gfx, sdl_net, sdl_mixer, sdl_ttf,
- sdl_image, sdl_mixer_nosmpeg,
- gtk2, glib2, pango, gdk2,
- unicode, cgi, terminal, libcurl,
- parsexml, parseopt, parsecfg,
- osproc,
- cairowin32, cairoxlib,
- gl, glut, glu, glx, glext, wingl,
- lua, lualib, lauxlib, mysql, sqlite3, db_mongo, md5, asyncio, mimetypes,
- cookies, events, ftpclient, scgi, irc
-
-
-writeln(stdout, "test compilation of binding modules")
diff --git a/tests/compile/tnewsets.nim b/tests/compile/tnewsets.nim
deleted file mode 100644
index 415fe8f7e..000000000
--- a/tests/compile/tnewsets.nim
+++ /dev/null
@@ -1,6 +0,0 @@
-# new test for sets:
-
-const elem = ' '
-
-var s: set[char] = {elem}
-assert(elem in s and 'a' not_in s and 'c' not_in s )
diff --git a/tests/compile/tnewuns.nim b/tests/compile/tnewuns.nim
deleted file mode 100644
index 5181e467c..000000000
--- a/tests/compile/tnewuns.nim
+++ /dev/null
@@ -1,12 +0,0 @@
-# test the new unsigned operations:
-
-import
- strutils
-
-var
- x, y: int
-
-x = 1
-y = high(int)
-
-writeln(stdout, $ ( x +% y ) )
diff --git a/tests/compile/tnoforward.nim b/tests/compile/tnoforward.nim
deleted file mode 100644
index 0359ff348..000000000
--- a/tests/compile/tnoforward.nim
+++ /dev/null
@@ -1,10 +0,0 @@
-{. noforward: on .}
-
-proc foo(x: int) =
- bar x
-
-proc bar(x: int) =
- echo x
-
-foo(10)
-
diff --git a/tests/compile/tparedef.nim b/tests/compile/tparedef.nim
deleted file mode 100644
index dedebf6b7..000000000
--- a/tests/compile/tparedef.nim
+++ /dev/null
@@ -1,4 +0,0 @@
-# This test is now superfluous:
-
-proc a(a: int) =
- return
diff --git a/tests/compile/tprep.nim b/tests/compile/tprep.nim
deleted file mode 100644
index 4ef9e2543..000000000
--- a/tests/compile/tprep.nim
+++ /dev/null
@@ -1,30 +0,0 @@
-# Test the features that used to belong to the preprocessor
-
-import
- times
-
-#{.warning: "This is only a test warning!".}
-
-const
- case2 = true
- case3 = true
-
-when defined(case1):
- {.hint: "Case 1".}
- when case3:
- {.hint: "Case 1.3".}
-elif case2:
- {.hint: "Case 2".}
- when case3:
- {.hint: "Case 2.3".}
-elif case3:
- {.hint: "Case 3".}
-else:
- {.hint: "unknown case".}
-
-var
- s: string
-write(stdout, "compiled at " & system.compileDate &
- " " & compileTime & "\n")
-echo getDateStr()
-echo getClockStr()
diff --git a/tests/compile/tquicksort.nim b/tests/compile/tquicksort.nim
deleted file mode 100644
index 6706a185e..000000000
--- a/tests/compile/tquicksort.nim
+++ /dev/null
@@ -1,26 +0,0 @@
-proc QuickSort(list: seq[int]): seq[int] =
- if len(list) == 0:
- return @[]
- var pivot = list[0]
- var left: seq[int] = @[]
- var right: seq[int] = @[]
- for i in low(list)..high(list):
- if list[i] < pivot:
- left.add(list[i])
- elif list[i] > pivot:
- right.add(list[i])
- result = QuickSort(left) &
- pivot &
- QuickSort(right)
-
-proc echoSeq(a: seq[int]) =
- for i in low(a)..high(a):
- echo(a[i])
-
-var
- list: seq[int]
-
-list = QuickSort(@[89,23,15,23,56,123,356,12,7,1,6,2,9,4,3])
-echoSeq(list)
-
-
diff --git a/tests/compile/tradix.nim b/tests/compile/tradix.nim
deleted file mode 100644
index e5998ee12..000000000
--- a/tests/compile/tradix.nim
+++ /dev/null
@@ -1,319 +0,0 @@
-# implements and tests an efficient radix tree
-
-## another method to store an efficient array of pointers:
-## We use a radix tree with node compression.
-## There are two node kinds:
-
-const bitsPerUnit = 8*sizeof(int)
-
-type
- TRadixNodeKind = enum rnLinear, rnFull, rnLeafBits, rnLeafLinear
- PRadixNode = ptr TRadixNode
- TRadixNode {.pure, inheritable.} = object
- kind: TRadixNodeKind
- TRadixNodeLinear = object of TRadixNode
- len: int8
- keys: array [0..31, int8]
- vals: array [0..31, PRadixNode]
-
- TRadixNodeFull = object of TRadixNode
- b: array [0..255, PRadixNode]
- TRadixNodeLeafBits = object of TRadixNode
- b: array [0..7, int]
- TRadixNodeLeafLinear = object of TRadixNode
- len: int8
- keys: array [0..31, int8]
-
-var
- root: PRadixNode
-
-proc searchInner(r: PRadixNode, a: int): PRadixNode =
- case r.kind
- of rnLinear:
- var x = cast[ptr TRadixNodeLinear](r)
- for i in 0..ze(x.len)-1:
- if ze(x.keys[i]) == a: return x.vals[i]
- of rnFull:
- var x = cast[ptr TRadixNodeFull](r)
- return x.b[a]
- else: assert(false)
-
-proc testBit(w, i: int): bool {.inline.} =
- result = (w and (1 shl (i %% BitsPerUnit))) != 0
-
-proc setBit(w: var int, i: int) {.inline.} =
- w = w or (1 shl (i %% bitsPerUnit))
-
-proc resetBit(w: var int, i: int) {.inline.} =
- w = w and not (1 shl (i %% bitsPerUnit))
-
-proc testOrSetBit(w: var int, i: int): bool {.inline.} =
- var x = (1 shl (i %% bitsPerUnit))
- if (w and x) != 0: return true
- w = w or x
-
-proc searchLeaf(r: PRadixNode, a: int): bool =
- case r.kind
- of rnLeafBits:
- var x = cast[ptr TRadixNodeLeafBits](r)
- return testBit(x.b[a /% BitsPerUnit], a)
- of rnLeafLinear:
- var x = cast[ptr TRadixNodeLeafLinear](r)
- for i in 0..ze(x.len)-1:
- if ze(x.keys[i]) == a: return true
- else: assert(false)
-
-proc exclLeaf(r: PRadixNode, a: int) =
- case r.kind
- of rnLeafBits:
- var x = cast[ptr TRadixNodeLeafBits](r)
- resetBit(x.b[a /% BitsPerUnit], a)
- of rnLeafLinear:
- var x = cast[ptr TRadixNodeLeafLinear](r)
- var L = ze(x.len)
- for i in 0..L-1:
- if ze(x.keys[i]) == a:
- x.keys[i] = x.keys[L-1]
- dec(x.len)
- return
- else: assert(false)
-
-proc contains*(r: PRadixNode, a: TAddress): bool =
- if r == nil: return false
- var x = searchInner(r, a shr 24 and 0xff)
- if x == nil: return false
- x = searchInner(x, a shr 16 and 0xff)
- if x == nil: return false
- x = searchInner(x, a shr 8 and 0xff)
- if x == nil: return false
- return searchLeaf(x, a and 0xff)
-
-proc excl*(r: PRadixNode, a: TAddress): bool =
- if r == nil: return false
- var x = searchInner(r, a shr 24 and 0xff)
- if x == nil: return false
- x = searchInner(x, a shr 16 and 0xff)
- if x == nil: return false
- x = searchInner(x, a shr 8 and 0xff)
- if x == nil: return false
- exclLeaf(x, a and 0xff)
-
-proc addLeaf(r: var PRadixNode, a: int): bool =
- if r == nil:
- # a linear node:
- var x = cast[ptr TRadixNodeLinear](alloc(sizeof(TRadixNodeLinear)))
- x.kind = rnLeafLinear
- x.len = 1'i8
- x.keys[0] = toU8(a)
- r = x
- return false # not already in set
- case r.kind
- of rnLeafBits:
- var x = cast[ptr TRadixNodeLeafBits](r)
- return testOrSetBit(x.b[a /% BitsPerUnit], a)
- of rnLeafLinear:
- var x = cast[ptr TRadixNodeLeafLinear](r)
- var L = ze(x.len)
- for i in 0..L-1:
- if ze(x.keys[i]) == a: return true
- if L <= high(x.keys):
- x.keys[L] = toU8(a)
- inc(x.len)
- else:
- # transform into a full node:
- var y = cast[ptr TRadixNodeLeafBits](alloc0(sizeof(TRadixNodeLeafBits)))
- y.kind = rnLeafBits
- for i in 0..ze(x.len)-1:
- var u = ze(x.keys[i])
- setBit(y.b[u /% BitsPerUnit], u)
- setBit(y.b[a /% BitsPerUnit], a)
- dealloc(r)
- r = y
- else: assert(false)
-
-proc addInner(r: var PRadixNode, a: int, d: int): bool =
- if d == 0:
- return addLeaf(r, a and 0xff)
- var k = a shr d and 0xff
- if r == nil:
- # a linear node:
- var x = cast[ptr TRadixNodeLinear](alloc(sizeof(TRadixNodeLinear)))
- x.kind = rnLinear
- x.len = 1'i8
- x.keys[0] = toU8(k)
- r = x
- return addInner(x.vals[0], a, d-8)
- case r.kind
- of rnLinear:
- var x = cast[ptr TRadixNodeLinear](r)
- var L = ze(x.len)
- for i in 0..L-1:
- if ze(x.keys[i]) == k: # already exists
- return addInner(x.vals[i], a, d-8)
- if L <= high(x.keys):
- x.keys[L] = toU8(k)
- inc(x.len)
- return addInner(x.vals[L], a, d-8)
- else:
- # transform into a full node:
- var y = cast[ptr TRadixNodeFull](alloc0(sizeof(TRadixNodeFull)))
- y.kind = rnFull
- for i in 0..L-1: y.b[ze(x.keys[i])] = x.vals[i]
- dealloc(r)
- r = y
- return addInner(y.b[k], a, d-8)
- of rnFull:
- var x = cast[ptr TRadixNodeFull](r)
- return addInner(x.b[k], a, d-8)
- else: assert(false)
-
-proc incl*(r: var PRadixNode, a: TAddress) {.inline.} =
- discard addInner(r, a, 24)
-
-proc testOrIncl*(r: var PRadixNode, a: TAddress): bool {.inline.} =
- return addInner(r, a, 24)
-
-iterator innerElements(r: PRadixNode): tuple[prefix: int, n: PRadixNode] =
- if r != nil:
- case r.kind
- of rnFull:
- var r = cast[ptr TRadixNodeFull](r)
- for i in 0..high(r.b):
- if r.b[i] != nil:
- yield (i, r.b[i])
- of rnLinear:
- var r = cast[ptr TRadixNodeLinear](r)
- for i in 0..ze(r.len)-1:
- yield (ze(r.keys[i]), r.vals[i])
- else: assert(false)
-
-iterator leafElements(r: PRadixNode): int =
- if r != nil:
- case r.kind
- of rnLeafBits:
- var r = cast[ptr TRadixNodeLeafBits](r)
- # iterate over any bit:
- for i in 0..high(r.b):
- if r.b[i] != 0: # test all bits for zero
- for j in 0..BitsPerUnit-1:
- if testBit(r.b[i], j):
- yield i*BitsPerUnit+j
- of rnLeafLinear:
- var r = cast[ptr TRadixNodeLeafLinear](r)
- for i in 0..ze(r.len)-1:
- yield ze(r.keys[i])
- else: assert(false)
-
-iterator elements*(r: PRadixNode): TAddress {.inline.} =
- for p1, n1 in innerElements(r):
- for p2, n2 in innerElements(n1):
- for p3, n3 in innerElements(n2):
- for p4 in leafElements(n3):
- yield p1 shl 24 or p2 shl 16 or p3 shl 8 or p4
-
-proc main() =
- const
- numbers = [128, 1, 2, 3, 4, 255, 17, -8, 45, 19_000]
- var
- r: PRadixNode = nil
- for x in items(numbers):
- echo testOrIncl(r, x)
- for x in elements(r): echo(x)
-
-main()
-
-
-when false:
- proc traverse(r: PRadixNode, prefix: int, d: int) =
- if r == nil: return
- case r.kind
- of rnLeafBits:
- assert(d == 0)
- var x = cast[ptr TRadixNodeLeafBits](r)
- # iterate over any bit:
- for i in 0..high(x.b):
- if x.b[i] != 0: # test all bits for zero
- for j in 0..BitsPerUnit-1:
- if testBit(x.b[i], j):
- visit(prefix or i*BitsPerUnit+j)
- of rnLeafLinear:
- assert(d == 0)
- var x = cast[ptr TRadixNodeLeafLinear](r)
- for i in 0..ze(x.len)-1:
- visit(prefix or ze(x.keys[i]))
- of rnFull:
- var x = cast[ptr TRadixNodeFull](r)
- for i in 0..high(r.b):
- if r.b[i] != nil:
- traverse(r.b[i], prefix or (i shl d), d-8)
- of rnLinear:
- var x = cast[ptr TRadixNodeLinear](r)
- for i in 0..ze(x.len)-1:
- traverse(x.vals[i], prefix or (ze(x.keys[i]) shl d), d-8)
-
- type
- TRadixIter {.final.} = object
- r: PRadixNode
- p: int
- x: int
-
- proc init(i: var TRadixIter, r: PRadixNode) =
- i.r = r
- i.x = 0
- i.p = 0
-
- proc nextr(i: var TRadixIter): PRadixNode =
- if i.r == nil: return nil
- case i.r.kind
- of rnFull:
- var r = cast[ptr TRadixNodeFull](i.r)
- while i.x <= high(r.b):
- if r.b[i.x] != nil:
- i.p = i.x
- return r.b[i.x]
- inc(i.x)
- of rnLinear:
- var r = cast[ptr TRadixNodeLinear](i.r)
- if i.x < ze(r.len):
- i.p = ze(r.keys[i.x])
- result = r.vals[i.x]
- inc(i.x)
- else: assert(false)
-
- proc nexti(i: var TRadixIter): int =
- result = -1
- case i.r.kind
- of rnLeafBits:
- var r = cast[ptr TRadixNodeLeafBits](i.r)
- # iterate over any bit:
- for i in 0..high(r.b):
- if x.b[i] != 0: # test all bits for zero
- for j in 0..BitsPerUnit-1:
- if testBit(x.b[i], j):
- visit(prefix or i*BitsPerUnit+j)
- of rnLeafLinear:
- var r = cast[ptr TRadixNodeLeafLinear](i.r)
- if i.x < ze(r.len):
- result = ze(r.keys[i.x])
- inc(i.x)
-
- iterator elements(r: PRadixNode): TAddress {.inline.} =
- var
- a, b, c, d: TRadixIter
- init(a, r)
- while true:
- var x = nextr(a)
- if x != nil:
- init(b, x)
- while true:
- var y = nextr(b)
- if y != nil:
- init(c, y)
- while true:
- var z = nextr(c)
- if z != nil:
- init(d, z)
- while true:
- var q = nexti(d)
- if q != -1:
- yield a.p shl 24 or b.p shl 16 or c.p shl 8 or q
diff --git a/tests/compile/treadln.nim b/tests/compile/treadln.nim
deleted file mode 100644
index 1117ab5f9..000000000
--- a/tests/compile/treadln.nim
+++ /dev/null
@@ -1,12 +0,0 @@
-# test the improved readline handling that does not care whether its
-# Macintosh, Unix or Windows text format.
-
-var
- inp: TFile
- line: string
-
-if open(inp, "readme.txt"):
- while not EndOfFile(inp):
- line = readLine(inp)
- echo("#" & line & "#")
- close(inp)
diff --git a/tests/compile/treadx.nim b/tests/compile/treadx.nim
deleted file mode 100644
index 49b6ad691..000000000
--- a/tests/compile/treadx.nim
+++ /dev/null
@@ -1,14 +0,0 @@
-
-when not defined(windows):
- import posix
-
- var inp = ""
- var buf: array[0..10, char]
- while true:
- var r = read(0, addr(buf), sizeof(buf)-1)
- add inp, $buf
- if r != sizeof(buf)-1: break
-
- echo inp
- #dafkladskölklödsaf ölksdakölfölksfklwe4iojr389wr 89uweokf sdlkf jweklr jweflksdj fioewjfsdlfsd
-
diff --git a/tests/compile/tshadow_magic_type.nim b/tests/compile/tshadow_magic_type.nim
deleted file mode 100644
index 5cd27435e..000000000
--- a/tests/compile/tshadow_magic_type.nim
+++ /dev/null
@@ -1,24 +0,0 @@
-type
- TListItemType* = enum
- RedisNil, RedisString
-
- TListItem* = object
- case kind*: TListItemType
- of RedisString:
- str*: string
- else: nil
- TRedisList* = seq[TListItem]
-
-# Caused by this.
-proc seq*() =
- nil
-
-proc lrange*(key: string): TRedisList =
- var foo: TListItem
- foo.kind = RedisNil
- result = @[foo]
-
-when isMainModule:
- var p = lrange("mylist")
- for i in items(p):
- echo(i.str)
diff --git a/tests/compile/tsizeof.nim b/tests/compile/tsizeof.nim
deleted file mode 100644
index f7b70dd4d..000000000
--- a/tests/compile/tsizeof.nim
+++ /dev/null
@@ -1,10 +0,0 @@
-# Test the sizeof proc
-
-type
- TMyRecord {.final.} = object
- x, y: int
- b: bool
- r: float
- s: string
-
-write(stdout, sizeof(TMyRecord))
diff --git a/tests/compile/tstrace.nim b/tests/compile/tstrace.nim
deleted file mode 100644
index 3032a34a3..000000000
--- a/tests/compile/tstrace.nim
+++ /dev/null
@@ -1,16 +0,0 @@
-# Test the new stacktraces (great for debugging!)
-
-{.push stack_trace: on.}
-
-proc recTest(i: int) =
- # enter
- if i < 10:
- recTest(i+1)
- else: # should printStackTrace()
- var p: ptr int = nil
- p[] = 12
- # leave
-
-{.pop.}
-
-recTest(0)
diff --git a/tests/compile/tstrdesc.nim b/tests/compile/tstrdesc.nim
deleted file mode 100644
index 1c2e85b4b..000000000
--- a/tests/compile/tstrdesc.nim
+++ /dev/null
@@ -1,14 +0,0 @@
-var
- x: array [0..2, int]
-
-x = [0, 1, 2]
-
-type
- TStringDesc {.final.} = object
- len, space: int # len and space without counting the terminating zero
- data: array [0..0, char] # for the '\0' character
-
-var
- emptyString {.exportc: "emptyString".}: TStringDesc
-
-
diff --git a/tests/compile/tstrdist.nim b/tests/compile/tstrdist.nim
deleted file mode 100644
index 3e1939e73..000000000
--- a/tests/compile/tstrdist.nim
+++ /dev/null
@@ -1,26 +0,0 @@
-# compute the edit distance between two strings
-
-proc editDistance(a, b: string): int =
- var
- c: seq[int]
- n = a.len
- m = b.len
- newSeq(c, (n+1)*(m+1))
- for i in 0..n:
- c[i*n] = i # [i,0]
- for j in 0..m:
- c[j] = j # [0,j]
-
- for i in 1..n:
- for j in 1..m:
- var x = c[(i-1)*n + j]+1
- var y = c[i*n + j-1]+1
- var z: int
- if a[i-1] == b[j-1]:
- z = c[(i-1)*n + j-1]
- else:
- z = c[(i-1)*n + j-1]+1
- c[(i-1)*n + (j-1)] = min(x,min(y,z))
- return c[n*m]
-
-write(stdout, editDistance("abc", "abd"))
diff --git a/tests/compile/tvarious.nim b/tests/compile/tvarious.nim
deleted file mode 100644
index 5883ba62f..000000000
--- a/tests/compile/tvarious.nim
+++ /dev/null
@@ -1,63 +0,0 @@
-# Test various aspects
-
-# bug #572
-var a=12345678901'u64
-
-var x = (x: 42, y: (a: 8, z: 10))
-echo x.y
-
-import
- mvarious
-
-type
- PA = ref TA
- PB = ref TB
-
- TB = object
- a: PA
-
- TA = object
- b: TB
- x: int
-
-proc getPA(): PA =
- var
- b: bool
- b = not false
- return nil
-
-# bug #501
-proc f(): int = 54
-
-var
- global: int
-
-var
- s: string
- i: int
- r: TA
-
-r.b.a.x = 0
-global = global + 1
-exportme()
-write(stdout, "Hallo wie heißt du? ")
-write(stdout, getPA().x)
-s = readLine(stdin)
-i = 0
-while i < s.len:
- if s[i] == 'c': write(stdout, "'c' in deinem Namen gefunden\n")
- i = i + 1
-
-write(stdout, "Du heißt " & s)
-
-# bug #544
-
-type Bar [T; I:range] = array[I, T]
-proc foo*[T; I:range](a, b: Bar[T, I]): Bar[T, I] =
- when len(a) != 3:
- # Error: constant expression expected
- {.fatal:"Dimensions have to be 3".}
- #...
-block:
- var a, b: Bar[int, 0..2]
- discard foo(a, b)
diff --git a/tests/compile/tcompiles.nim b/tests/compiles/tcompiles.nim
similarity index 100%
rename from tests/compile/tcompiles.nim
rename to tests/compiles/tcompiles.nim
diff --git a/tests/run/tconcat.nim b/tests/concat/tconcat.nim
similarity index 100%
rename from tests/run/tconcat.nim
rename to tests/concat/tconcat.nim
diff --git a/tests/run/tnodeadlocks.nim b/tests/concurrency/tnodeadlocks.nim
similarity index 100%
rename from tests/run/tnodeadlocks.nim
rename to tests/concurrency/tnodeadlocks.nim
diff --git a/tests/reject/tconstr1.nim b/tests/constr/tconstr1.nim
similarity index 100%
rename from tests/reject/tconstr1.nim
rename to tests/constr/tconstr1.nim
diff --git a/tests/run/tconstr2.nim b/tests/constr/tconstr2.nim
similarity index 100%
rename from tests/run/tconstr2.nim
rename to tests/constr/tconstr2.nim
diff --git a/tests/reject/tconstraints.nim b/tests/constraints/tconstraints.nim
similarity index 100%
rename from tests/reject/tconstraints.nim
rename to tests/constraints/tconstraints.nim
diff --git a/tests/run/tcontinue.nim b/tests/controlflow/tcontinue.nim
similarity index 100%
rename from tests/run/tcontinue.nim
rename to tests/controlflow/tcontinue.nim
diff --git a/tests/reject/tstatret.nim b/tests/controlflow/tstatret.nim
similarity index 100%
rename from tests/reject/tstatret.nim
rename to tests/controlflow/tstatret.nim
diff --git a/tests/compile/tconvcolors.nim b/tests/converter/tconvcolors.nim
similarity index 100%
rename from tests/compile/tconvcolors.nim
rename to tests/converter/tconvcolors.nim
diff --git a/tests/compile/tconvert.nim b/tests/converter/tconvert.nim
similarity index 100%
rename from tests/compile/tconvert.nim
rename to tests/converter/tconvert.nim
diff --git a/tests/run/tgenericconverter.nim b/tests/converter/tgenericconverter.nim
similarity index 100%
rename from tests/run/tgenericconverter.nim
rename to tests/converter/tgenericconverter.nim
diff --git a/tests/compile/ttypeconverter1.nim b/tests/converter/ttypeconverter1.nim
similarity index 100%
rename from tests/compile/ttypeconverter1.nim
rename to tests/converter/ttypeconverter1.nim
diff --git a/tests/compile/mdefaultprocparam.nim b/tests/defaultprocparam/mdefaultprocparam.nim
similarity index 100%
rename from tests/compile/mdefaultprocparam.nim
rename to tests/defaultprocparam/mdefaultprocparam.nim
diff --git a/tests/compile/tdefaultprocparam.nim b/tests/defaultprocparam/tdefaultprocparam.nim
similarity index 100%
rename from tests/compile/tdefaultprocparam.nim
rename to tests/defaultprocparam/tdefaultprocparam.nim
diff --git a/tests/reject/tdeprecated.nim b/tests/deprecated/tdeprecated.nim
similarity index 100%
rename from tests/reject/tdeprecated.nim
rename to tests/deprecated/tdeprecated.nim
diff --git a/tests/run/tdestructor.nim b/tests/destructor/tdestructor.nim
similarity index 100%
rename from tests/run/tdestructor.nim
rename to tests/destructor/tdestructor.nim
diff --git a/tests/reject/tdestructor.nim b/tests/destructor/tdestructor2.nim
similarity index 100%
rename from tests/reject/tdestructor.nim
rename to tests/destructor/tdestructor2.nim
diff --git a/tests/compile/tdictdestruct.nim b/tests/destructor/tdictdestruct.nim
similarity index 100%
rename from tests/compile/tdictdestruct.nim
rename to tests/destructor/tdictdestruct.nim
diff --git a/tests/compile/tdiscardable.nim b/tests/discard/tdiscardable.nim
similarity index 100%
rename from tests/compile/tdiscardable.nim
rename to tests/discard/tdiscardable.nim
diff --git a/tests/reject/tneedsdiscard.nim b/tests/discard/tneedsdiscard.nim
similarity index 100%
rename from tests/reject/tneedsdiscard.nim
rename to tests/discard/tneedsdiscard.nim
diff --git a/tests/run/tcurrncy.nim b/tests/distinct/tcurrncy.nim
similarity index 100%
rename from tests/run/tcurrncy.nim
rename to tests/distinct/tcurrncy.nim
diff --git a/tests/reject/teffects1.nim b/tests/effects/teffects1.nim
similarity index 100%
rename from tests/reject/teffects1.nim
rename to tests/effects/teffects1.nim
diff --git a/tests/reject/teffects2.nim b/tests/effects/teffects2.nim
similarity index 100%
rename from tests/reject/teffects2.nim
rename to tests/effects/teffects2.nim
diff --git a/tests/reject/teffects3.nim b/tests/effects/teffects3.nim
similarity index 100%
rename from tests/reject/teffects3.nim
rename to tests/effects/teffects3.nim
diff --git a/tests/reject/teffects4.nim b/tests/effects/teffects4.nim
similarity index 100%
rename from tests/reject/teffects4.nim
rename to tests/effects/teffects4.nim
diff --git a/tests/reject/teffects5.nim b/tests/effects/teffects5.nim
similarity index 100%
rename from tests/reject/teffects5.nim
rename to tests/effects/teffects5.nim
diff --git a/tests/compile/teffects1.nim b/tests/effects/teffects6.nim
similarity index 100%
rename from tests/compile/teffects1.nim
rename to tests/effects/teffects6.nim
diff --git a/tests/reject/tsidee1.nim b/tests/effects/tsidee1.nim
similarity index 100%
rename from tests/reject/tsidee1.nim
rename to tests/effects/tsidee1.nim
diff --git a/tests/run/tsidee2.nim b/tests/effects/tsidee2.nim
similarity index 100%
rename from tests/run/tsidee2.nim
rename to tests/effects/tsidee2.nim
diff --git a/tests/run/tsidee3.nim b/tests/effects/tsidee3.nim
similarity index 100%
rename from tests/run/tsidee3.nim
rename to tests/effects/tsidee3.nim
diff --git a/tests/reject/tsidee4.nim b/tests/effects/tsidee4.nim
similarity index 100%
rename from tests/reject/tsidee4.nim
rename to tests/effects/tsidee4.nim
diff --git a/tests/compile/tenum.nim b/tests/enum/tenum.nim
similarity index 100%
rename from tests/compile/tenum.nim
rename to tests/enum/tenum.nim
diff --git a/tests/compile/tenum2.nim b/tests/enum/tenum2.nim
similarity index 100%
rename from tests/compile/tenum2.nim
rename to tests/enum/tenum2.nim
diff --git a/tests/compile/tenum3.nim b/tests/enum/tenum3.nim
similarity index 100%
rename from tests/compile/tenum3.nim
rename to tests/enum/tenum3.nim
diff --git a/tests/run/tenumhole.nim b/tests/enum/tenumhole.nim
similarity index 100%
rename from tests/run/tenumhole.nim
rename to tests/enum/tenumhole.nim
diff --git a/tests/reject/tenumitems.nim b/tests/enum/tenumitems.nim
similarity index 100%
rename from tests/reject/tenumitems.nim
rename to tests/enum/tenumitems.nim
diff --git a/tests/run/tenumitems.nim b/tests/enum/tenumitems2.nim
similarity index 100%
rename from tests/run/tenumitems.nim
rename to tests/enum/tenumitems2.nim
diff --git a/tests/reject/tenummix.nim b/tests/enum/tenummix.nim
similarity index 100%
rename from tests/reject/tenummix.nim
rename to tests/enum/tenummix.nim
diff --git a/tests/run/tnamedenumfields.nim b/tests/enum/tnamedenumfields.nim
similarity index 100%
rename from tests/run/tnamedenumfields.nim
rename to tests/enum/tnamedenumfields.nim
diff --git a/tests/compile/toptions.nim b/tests/enum/toptions.nim
similarity index 100%
rename from tests/compile/toptions.nim
rename to tests/enum/toptions.nim
diff --git a/tests/run/tcontinuexc.nim b/tests/exception/tcontinuexc.nim
similarity index 100%
rename from tests/run/tcontinuexc.nim
rename to tests/exception/tcontinuexc.nim
diff --git a/tests/run/texceptions.nim b/tests/exception/texceptions.nim
similarity index 100%
rename from tests/run/texceptions.nim
rename to tests/exception/texceptions.nim
diff --git a/tests/run/texcpt1.nim b/tests/exception/texcpt1.nim
similarity index 100%
rename from tests/run/texcpt1.nim
rename to tests/exception/texcpt1.nim
diff --git a/tests/run/texcsub.nim b/tests/exception/texcsub.nim
similarity index 100%
rename from tests/run/texcsub.nim
rename to tests/exception/texcsub.nim
diff --git a/tests/run/tfinally.nim b/tests/exception/tfinally.nim
similarity index 100%
rename from tests/run/tfinally.nim
rename to tests/exception/tfinally.nim
diff --git a/tests/run/tfinally2.nim b/tests/exception/tfinally2.nim
similarity index 100%
rename from tests/run/tfinally2.nim
rename to tests/exception/tfinally2.nim
diff --git a/tests/run/tfinally3.nim b/tests/exception/tfinally3.nim
similarity index 100%
rename from tests/run/tfinally3.nim
rename to tests/exception/tfinally3.nim
diff --git a/tests/run/tonraise.nim b/tests/exception/tonraise.nim
similarity index 100%
rename from tests/run/tonraise.nim
rename to tests/exception/tonraise.nim
diff --git a/tests/run/treraise.nim b/tests/exception/treraise.nim
similarity index 100%
rename from tests/run/treraise.nim
rename to tests/exception/treraise.nim
diff --git a/tests/run/tunhandledexc.nim b/tests/exception/tunhandledexc.nim
similarity index 100%
rename from tests/run/tunhandledexc.nim
rename to tests/exception/tunhandledexc.nim
diff --git a/tests/run/twrongexc.nim b/tests/exception/twrongexc.nim
similarity index 100%
rename from tests/run/twrongexc.nim
rename to tests/exception/twrongexc.nim
diff --git a/tests/reject/texprstmt.nim b/tests/exprs/texprstmt.nim
similarity index 100%
rename from tests/reject/texprstmt.nim
rename to tests/exprs/texprstmt.nim
diff --git a/tests/reject/tstmtexp.nim b/tests/exprs/tstmtexp.nim
similarity index 100%
rename from tests/reject/tstmtexp.nim
rename to tests/exprs/tstmtexp.nim
diff --git a/tests/run/tstmtexprs.nim b/tests/exprs/tstmtexprs.nim
similarity index 100%
rename from tests/run/tstmtexprs.nim
rename to tests/exprs/tstmtexprs.nim
diff --git a/tests/run/tfieldindex.nim b/tests/fields/tfieldindex.nim
similarity index 100%
rename from tests/run/tfieldindex.nim
rename to tests/fields/tfieldindex.nim
diff --git a/tests/run/tfielditerator.nim b/tests/fields/tfielditerator.nim
similarity index 100%
rename from tests/run/tfielditerator.nim
rename to tests/fields/tfielditerator.nim
diff --git a/tests/run/tfielditerator2.nim b/tests/fields/tfielditerator2.nim
similarity index 100%
rename from tests/run/tfielditerator2.nim
rename to tests/fields/tfielditerator2.nim
diff --git a/tests/run/tfloat1.nim b/tests/float/tfloat1.nim
similarity index 100%
rename from tests/run/tfloat1.nim
rename to tests/float/tfloat1.nim
diff --git a/tests/run/tfloat2.nim b/tests/float/tfloat2.nim
similarity index 100%
rename from tests/run/tfloat2.nim
rename to tests/float/tfloat2.nim
diff --git a/tests/run/tfloat3.nim b/tests/float/tfloat3.nim
similarity index 100%
rename from tests/run/tfloat3.nim
rename to tests/float/tfloat3.nim
diff --git a/tests/run/mfriends.nim b/tests/friends/mfriends.nim
similarity index 100%
rename from tests/run/mfriends.nim
rename to tests/friends/mfriends.nim
diff --git a/tests/run/tfriends.nim b/tests/friends/tfriends.nim
similarity index 100%
rename from tests/run/tfriends.nim
rename to tests/friends/tfriends.nim
diff --git a/tests/run/tbintre2.nim b/tests/generics/tbintre2.nim
similarity index 100%
rename from tests/run/tbintre2.nim
rename to tests/generics/tbintre2.nim
diff --git a/tests/run/tbintree.nim b/tests/generics/tbintree.nim
similarity index 100%
rename from tests/run/tbintree.nim
rename to tests/generics/tbintree.nim
diff --git a/tests/compile/tcan_alias_generic.nim b/tests/generics/tcan_alias_generic.nim
similarity index 100%
rename from tests/compile/tcan_alias_generic.nim
rename to tests/generics/tcan_alias_generic.nim
diff --git a/tests/compile/tcan_alias_specialised_generic.nim b/tests/generics/tcan_alias_specialised_generic.nim
similarity index 100%
rename from tests/compile/tcan_alias_specialised_generic.nim
rename to tests/generics/tcan_alias_specialised_generic.nim
diff --git a/tests/compile/tcan_inherit_generic.nim b/tests/generics/tcan_inherit_generic.nim
similarity index 100%
rename from tests/compile/tcan_inherit_generic.nim
rename to tests/generics/tcan_inherit_generic.nim
diff --git a/tests/compile/tcan_specialise_generic.nim b/tests/generics/tcan_specialise_generic.nim
similarity index 100%
rename from tests/compile/tcan_specialise_generic.nim
rename to tests/generics/tcan_specialise_generic.nim
diff --git a/tests/run/texplicitgeneric1.nim b/tests/generics/texplicitgeneric1.nim
similarity index 100%
rename from tests/run/texplicitgeneric1.nim
rename to tests/generics/texplicitgeneric1.nim
diff --git a/tests/run/texplicitgeneric2.nim b/tests/generics/texplicitgeneric2.nim
similarity index 100%
rename from tests/run/texplicitgeneric2.nim
rename to tests/generics/texplicitgeneric2.nim
diff --git a/tests/compile/tforwardgeneric.nim b/tests/generics/tforwardgeneric.nim
similarity index 100%
rename from tests/compile/tforwardgeneric.nim
rename to tests/generics/tforwardgeneric.nim
diff --git a/tests/compile/tgeneric.nim b/tests/generics/tgeneric0.nim
similarity index 100%
rename from tests/compile/tgeneric.nim
rename to tests/generics/tgeneric0.nim
diff --git a/tests/run/tgenerics1.nim b/tests/generics/tgeneric1.nim
similarity index 100%
rename from tests/run/tgenerics1.nim
rename to tests/generics/tgeneric1.nim
diff --git a/tests/compile/tgeneric2.nim b/tests/generics/tgeneric2.nim
similarity index 100%
rename from tests/compile/tgeneric2.nim
rename to tests/generics/tgeneric2.nim
diff --git a/tests/compile/tgeneric3.nim b/tests/generics/tgeneric3.nim
similarity index 100%
rename from tests/compile/tgeneric3.nim
rename to tests/generics/tgeneric3.nim
diff --git a/tests/compile/tgeneric4.nim b/tests/generics/tgeneric4.nim
similarity index 100%
rename from tests/compile/tgeneric4.nim
rename to tests/generics/tgeneric4.nim
diff --git a/tests/compile/tgenericdefaults.nim b/tests/generics/tgenericdefaults.nim
similarity index 100%
rename from tests/compile/tgenericdefaults.nim
rename to tests/generics/tgenericdefaults.nim
diff --git a/tests/compile/tgenericmatcher.nim b/tests/generics/tgenericmatcher.nim
similarity index 100%
rename from tests/compile/tgenericmatcher.nim
rename to tests/generics/tgenericmatcher.nim
diff --git a/tests/compile/tgenericmatcher2.nim b/tests/generics/tgenericmatcher2.nim
similarity index 100%
rename from tests/compile/tgenericmatcher2.nim
rename to tests/generics/tgenericmatcher2.nim
diff --git a/tests/run/tgenericprocvar.nim b/tests/generics/tgenericprocvar.nim
similarity index 100%
rename from tests/run/tgenericprocvar.nim
rename to tests/generics/tgenericprocvar.nim
diff --git a/tests/compile/tgenericprop.nim b/tests/generics/tgenericprop.nim
similarity index 100%
rename from tests/compile/tgenericprop.nim
rename to tests/generics/tgenericprop.nim
diff --git a/tests/compile/tgenericrefs.nim b/tests/generics/tgenericrefs.nim
similarity index 100%
rename from tests/compile/tgenericrefs.nim
rename to tests/generics/tgenericrefs.nim
diff --git a/tests/compile/tgenericshardcases.nim b/tests/generics/tgenericshardcases.nim
similarity index 100%
rename from tests/compile/tgenericshardcases.nim
rename to tests/generics/tgenericshardcases.nim
diff --git a/tests/compile/tgenerictmpl.nim b/tests/generics/tgenerictmpl.nim
similarity index 100%
rename from tests/compile/tgenerictmpl.nim
rename to tests/generics/tgenerictmpl.nim
diff --git a/tests/compile/tgenericvariant.nim b/tests/generics/tgenericvariant.nim
similarity index 100%
rename from tests/compile/tgenericvariant.nim
rename to tests/generics/tgenericvariant.nim
diff --git a/tests/compile/tspecialised_is_equivalent.nim b/tests/generics/tspecialised_is_equivalent.nim
similarity index 100%
rename from tests/compile/tspecialised_is_equivalent.nim
rename to tests/generics/tspecialised_is_equivalent.nim
diff --git a/tests/compile/tthread_generic.nim b/tests/generics/tthread_generic.nim
similarity index 100%
rename from tests/compile/tthread_generic.nim
rename to tests/generics/tthread_generic.nim
diff --git a/tests/run/tvarargs_vs_generic.nim b/tests/generics/tvarargs_vs_generic.nim
similarity index 100%
rename from tests/run/tvarargs_vs_generic.nim
rename to tests/generics/tvarargs_vs_generic.nim
diff --git a/tests/run/tgensym.nim b/tests/gensym/tgensym.nim
similarity index 100%
rename from tests/run/tgensym.nim
rename to tests/gensym/tgensym.nim
diff --git a/tests/compile/tgensymgeneric.nim b/tests/gensym/tgensymgeneric.nim
similarity index 100%
rename from tests/compile/tgensymgeneric.nim
rename to tests/gensym/tgensymgeneric.nim
diff --git a/tests/run/tglobal.nim b/tests/global/tglobal.nim
similarity index 100%
rename from tests/run/tglobal.nim
rename to tests/global/tglobal.nim
diff --git a/tests/compile/tglobalforvar.nim b/tests/global/tglobalforvar.nim
similarity index 100%
rename from tests/compile/tglobalforvar.nim
rename to tests/global/tglobalforvar.nim
diff --git a/tests/run/tnestif.nim b/tests/ifstmt/tnestif.nim
similarity index 100%
rename from tests/run/tnestif.nim
rename to tests/ifstmt/tnestif.nim
diff --git a/tests/compile/timplicititems.nim b/tests/implicit/timplicititems.nim
similarity index 100%
rename from tests/compile/timplicititems.nim
rename to tests/implicit/timplicititems.nim
diff --git a/tests/compile/timplictderef.nim b/tests/implicit/timplictderef.nim
similarity index 100%
rename from tests/compile/timplictderef.nim
rename to tests/implicit/timplictderef.nim
diff --git a/tests/run/tdrdobbs_examples.nim b/tests/important/tdrdobbs_examples.nim
similarity index 100%
rename from tests/run/tdrdobbs_examples.nim
rename to tests/important/tdrdobbs_examples.nim
diff --git a/tests/reject/tuninit1.nim b/tests/init/tuninit1.nim
similarity index 100%
rename from tests/reject/tuninit1.nim
rename to tests/init/tuninit1.nim
diff --git a/tests/run/tzeroarray.nim b/tests/init/tzeroarray.nim
similarity index 100%
rename from tests/run/tzeroarray.nim
rename to tests/init/tzeroarray.nim
diff --git a/tests/run/tcountup.nim b/tests/iter/tcountup.nim
similarity index 100%
rename from tests/run/tcountup.nim
rename to tests/iter/tcountup.nim
diff --git a/tests/compile/titer.nim b/tests/iter/titer.nim
similarity index 100%
rename from tests/compile/titer.nim
rename to tests/iter/titer.nim
diff --git a/tests/compile/titer2.nim b/tests/iter/titer2.nim
similarity index 100%
rename from tests/compile/titer2.nim
rename to tests/iter/titer2.nim
diff --git a/tests/run/titer3.nim b/tests/iter/titer3.nim
similarity index 100%
rename from tests/run/titer3.nim
rename to tests/iter/titer3.nim
diff --git a/tests/reject/titer4.nim b/tests/iter/titer4.nim
similarity index 100%
rename from tests/reject/titer4.nim
rename to tests/iter/titer4.nim
diff --git a/tests/run/titer5.nim b/tests/iter/titer5.nim
similarity index 100%
rename from tests/run/titer5.nim
rename to tests/iter/titer5.nim
diff --git a/tests/run/titer6.nim b/tests/iter/titer6.nim
similarity index 100%
rename from tests/run/titer6.nim
rename to tests/iter/titer6.nim
diff --git a/tests/run/titer7.nim b/tests/iter/titer7.nim
similarity index 100%
rename from tests/run/titer7.nim
rename to tests/iter/titer7.nim
diff --git a/tests/run/titer8.nim b/tests/iter/titer8.nim
similarity index 100%
rename from tests/run/titer8.nim
rename to tests/iter/titer8.nim
diff --git a/tests/run/titer9.nim b/tests/iter/titer9.nim
similarity index 100%
rename from tests/run/titer9.nim
rename to tests/iter/titer9.nim
diff --git a/tests/compile/titer_no_tuple_unpack.nim b/tests/iter/titer_no_tuple_unpack.nim
similarity index 100%
rename from tests/compile/titer_no_tuple_unpack.nim
rename to tests/iter/titer_no_tuple_unpack.nim
diff --git a/tests/compile/titerovl.nim b/tests/iter/titerovl.nim
similarity index 100%
rename from tests/compile/titerovl.nim
rename to tests/iter/titerovl.nim
diff --git a/tests/run/titerslice.nim b/tests/iter/titerslice.nim
similarity index 100%
rename from tests/run/titerslice.nim
rename to tests/iter/titerslice.nim
diff --git a/tests/run/titervaropenarray.nim b/tests/iter/titervaropenarray.nim
similarity index 100%
rename from tests/run/titervaropenarray.nim
rename to tests/iter/titervaropenarray.nim
diff --git a/tests/run/tmoditer.nim b/tests/iter/tmoditer.nim
similarity index 100%
rename from tests/run/tmoditer.nim
rename to tests/iter/tmoditer.nim
diff --git a/tests/reject/treciter.nim b/tests/iter/treciter.nim
similarity index 100%
rename from tests/reject/treciter.nim
rename to tests/iter/treciter.nim
diff --git a/tests/reject/twrongiter.nim b/tests/iter/twrongiter.nim
similarity index 100%
rename from tests/reject/twrongiter.nim
rename to tests/iter/twrongiter.nim
diff --git a/tests/reject/tlet.nim b/tests/let/tlet.nim
similarity index 100%
rename from tests/reject/tlet.nim
rename to tests/let/tlet.nim
diff --git a/tests/reject/tlet2.nim b/tests/let/tlet2.nim
similarity index 100%
rename from tests/reject/tlet2.nim
rename to tests/let/tlet2.nim
diff --git a/tests/run/thexlit.nim b/tests/lexer/thexlit.nim
similarity index 100%
rename from tests/run/thexlit.nim
rename to tests/lexer/thexlit.nim
diff --git a/tests/compile/thexrange.nim b/tests/lexer/thexrange.nim
similarity index 100%
rename from tests/compile/thexrange.nim
rename to tests/lexer/thexrange.nim
diff --git a/tests/compile/tident.nim b/tests/lexer/tident.nim
similarity index 100%
rename from tests/compile/tident.nim
rename to tests/lexer/tident.nim
diff --git a/tests/reject/tind1.nim b/tests/lexer/tind1.nim
similarity index 100%
rename from tests/reject/tind1.nim
rename to tests/lexer/tind1.nim
diff --git a/tests/run/tindent1.nim b/tests/lexer/tindent1.nim
similarity index 100%
rename from tests/run/tindent1.nim
rename to tests/lexer/tindent1.nim
diff --git a/tests/compile/tlexer.nim b/tests/lexer/tlexer.nim
similarity index 100%
rename from tests/compile/tlexer.nim
rename to tests/lexer/tlexer.nim
diff --git a/tests/reject/tmissingnl.nim b/tests/lexer/tmissingnl.nim
similarity index 100%
rename from tests/reject/tmissingnl.nim
rename to tests/lexer/tmissingnl.nim
diff --git a/tests/run/tstrlits.nim b/tests/lexer/tstrlits.nim
similarity index 100%
rename from tests/run/tstrlits.nim
rename to tests/lexer/tstrlits.nim
diff --git a/tests/reject/tunderscores.nim b/tests/lexer/tunderscores.nim
similarity index 100%
rename from tests/reject/tunderscores.nim
rename to tests/lexer/tunderscores.nim
diff --git a/tests/compile/tredef.nim b/tests/lookup/tredef.nim
similarity index 100%
rename from tests/compile/tredef.nim
rename to tests/lookup/tredef.nim
diff --git a/tests/run/tkoeniglookup.nim b/tests/lookups/tkoeniglookup.nim
similarity index 100%
rename from tests/run/tkoeniglookup.nim
rename to tests/lookups/tkoeniglookup.nim
diff --git a/tests/compile/tmacro1.nim b/tests/macro/tmacro1.nim
similarity index 100%
rename from tests/compile/tmacro1.nim
rename to tests/macro/tmacro1.nim
diff --git a/tests/run/tmacro2.nim b/tests/macro/tmacro2.nim
similarity index 100%
rename from tests/run/tmacro2.nim
rename to tests/macro/tmacro2.nim
diff --git a/tests/run/tmacro3.nim b/tests/macro/tmacro3.nim
similarity index 100%
rename from tests/run/tmacro3.nim
rename to tests/macro/tmacro3.nim
diff --git a/tests/run/tmacro4.nim b/tests/macro/tmacro4.nim
similarity index 100%
rename from tests/run/tmacro4.nim
rename to tests/macro/tmacro4.nim
diff --git a/tests/compile/tmacro2.nim b/tests/macro/tmacro5.nim
similarity index 100%
rename from tests/compile/tmacro2.nim
rename to tests/macro/tmacro5.nim
diff --git a/tests/compile/tmacroaspragma.nim b/tests/macro/tmacroaspragma.nim
similarity index 100%
rename from tests/compile/tmacroaspragma.nim
rename to tests/macro/tmacroaspragma.nim
diff --git a/tests/run/tmacrogenerics.nim b/tests/macro/tmacrogenerics.nim
similarity index 100%
rename from tests/run/tmacrogenerics.nim
rename to tests/macro/tmacrogenerics.nim
diff --git a/tests/run/tmacros1.nim b/tests/macro/tmacros1.nim
similarity index 100%
rename from tests/run/tmacros1.nim
rename to tests/macro/tmacros1.nim
diff --git a/tests/compile/tmacrostmt.nim b/tests/macro/tmacrostmt.nim
similarity index 100%
rename from tests/compile/tmacrostmt.nim
rename to tests/macro/tmacrostmt.nim
diff --git a/tests/compile/tmacrotypes.nim b/tests/macro/tmacrotypes.nim
similarity index 100%
rename from tests/compile/tmacrotypes.nim
rename to tests/macro/tmacrotypes.nim
diff --git a/tests/compile/tnimrodnode_for_runtime.nim b/tests/macro/tnimrodnode_for_runtime.nim
similarity index 100%
rename from tests/compile/tnimrodnode_for_runtime.nim
rename to tests/macro/tnimrodnode_for_runtime.nim
diff --git a/tests/run/tprintf.nim b/tests/macro/tprintf.nim
similarity index 100%
rename from tests/run/tprintf.nim
rename to tests/macro/tprintf.nim
diff --git a/tests/run/tquotewords.nim b/tests/macro/tquotewords.nim
similarity index 100%
rename from tests/run/tquotewords.nim
rename to tests/macro/tquotewords.nim
diff --git a/tests/reject/trecmacro.nim b/tests/macro/trecmacro.nim
similarity index 100%
rename from tests/reject/trecmacro.nim
rename to tests/macro/trecmacro.nim
diff --git a/tests/run/tstringinterp.nim b/tests/macro/tstringinterp.nim
similarity index 100%
rename from tests/run/tstringinterp.nim
rename to tests/macro/tstringinterp.nim
diff --git a/tests/run/tvtable.nim b/tests/macro/tvtable.nim
similarity index 100%
rename from tests/run/tvtable.nim
rename to tests/macro/tvtable.nim
diff --git a/tests/compile/tdumpast.nim b/tests/macros/tdumpast.nim
similarity index 100%
rename from tests/compile/tdumpast.nim
rename to tests/macros/tdumpast.nim
diff --git a/tests/compile/tdumpast2.nim b/tests/macros/tdumpast2.nim
similarity index 100%
rename from tests/compile/tdumpast2.nim
rename to tests/macros/tdumpast2.nim
diff --git a/tests/run/tdumptree.nim b/tests/macros/tdumptree.nim
similarity index 100%
rename from tests/run/tdumptree.nim
rename to tests/macros/tdumptree.nim
diff --git a/tests/run/tidgen.nim b/tests/macros/tidgen.nim
similarity index 100%
rename from tests/run/tidgen.nim
rename to tests/macros/tidgen.nim
diff --git a/tests/run/tlowhigh.nim b/tests/magics/tlowhigh.nim
similarity index 100%
rename from tests/run/tlowhigh.nim
rename to tests/magics/tlowhigh.nim
diff --git a/tests/run/tmatrix.nim b/tests/matrix/tmatrix.nim
similarity index 100%
rename from tests/run/tmatrix.nim
rename to tests/matrix/tmatrix.nim
diff --git a/tests/compile/tmatrix1.nim b/tests/matrix/tmatrix1.nim
similarity index 100%
rename from tests/compile/tmatrix1.nim
rename to tests/matrix/tmatrix1.nim
diff --git a/tests/compile/tmatrix2.nim b/tests/matrix/tmatrix2.nim
similarity index 100%
rename from tests/compile/tmatrix2.nim
rename to tests/matrix/tmatrix2.nim
diff --git a/tests/compile/tbindtypedesc.nim b/tests/metatype/tbindtypedesc.nim
similarity index 100%
rename from tests/compile/tbindtypedesc.nim
rename to tests/metatype/tbindtypedesc.nim
diff --git a/tests/compile/tcompositetypeclasses.nim b/tests/metatype/tcompositetypeclasses.nim
similarity index 100%
rename from tests/compile/tcompositetypeclasses.nim
rename to tests/metatype/tcompositetypeclasses.nim
diff --git a/tests/compile/tconstraints.nim b/tests/metatype/tconstraints.nim
similarity index 100%
rename from tests/compile/tconstraints.nim
rename to tests/metatype/tconstraints.nim
diff --git a/tests/run/tsemistatic.nim b/tests/metatype/tsemistatic.nim
similarity index 100%
rename from tests/run/tsemistatic.nim
rename to tests/metatype/tsemistatic.nim
diff --git a/tests/metatype/ttypebar.nim b/tests/metatype/ttypebar.nim
new file mode 100644
index 000000000..304dfffcb
--- /dev/null
+++ b/tests/metatype/ttypebar.nim
@@ -0,0 +1,14 @@
+
+# bug #602
+
+type
+ TTest = object
+ TTest2* = object
+ TFoo = TTest | TTest2
+
+proc f(src: ptr TFoo, dst: ptr TFoo) =
+ echo("asd")
+
+var x: TTest
+f(addr x, addr x)
+
diff --git a/tests/compile/ttypeclasses.nim b/tests/metatype/ttypeclasses.nim
similarity index 100%
rename from tests/compile/ttypeclasses.nim
rename to tests/metatype/ttypeclasses.nim
diff --git a/tests/run/ttypedesc1.nim b/tests/metatype/ttypedesc1.nim
similarity index 100%
rename from tests/run/ttypedesc1.nim
rename to tests/metatype/ttypedesc1.nim
diff --git a/tests/compile/ttypeselectors.nim b/tests/metatype/ttypeselectors.nim
similarity index 100%
rename from tests/compile/ttypeselectors.nim
rename to tests/metatype/ttypeselectors.nim
diff --git a/tests/run/ttypetraits.nim b/tests/metatype/ttypetraits.nim
similarity index 100%
rename from tests/run/ttypetraits.nim
rename to tests/metatype/ttypetraits.nim
diff --git a/tests/run/tusertypeclasses.nim b/tests/metatype/tusertypeclasses.nim
similarity index 100%
rename from tests/run/tusertypeclasses.nim
rename to tests/metatype/tusertypeclasses.nim
diff --git a/tests/run/utypeclasses.nim b/tests/metatype/utypeclasses.nim
similarity index 100%
rename from tests/run/utypeclasses.nim
rename to tests/metatype/utypeclasses.nim
diff --git a/tests/run/mmultim3.nim b/tests/method/mmultim3.nim
similarity index 100%
rename from tests/run/mmultim3.nim
rename to tests/method/mmultim3.nim
diff --git a/tests/reject/tmethod.nim b/tests/method/tmethod.nim
similarity index 100%
rename from tests/reject/tmethod.nim
rename to tests/method/tmethod.nim
diff --git a/tests/run/tmethods1.nim b/tests/method/tmethods1.nim
similarity index 100%
rename from tests/run/tmethods1.nim
rename to tests/method/tmethods1.nim
diff --git a/tests/run/tmultim1.nim b/tests/method/tmultim1.nim
similarity index 100%
rename from tests/run/tmultim1.nim
rename to tests/method/tmultim1.nim
diff --git a/tests/run/tmultim2.nim b/tests/method/tmultim2.nim
similarity index 100%
rename from tests/run/tmultim2.nim
rename to tests/method/tmultim2.nim
diff --git a/tests/run/tmultim3.nim b/tests/method/tmultim3.nim
similarity index 100%
rename from tests/run/tmultim3.nim
rename to tests/method/tmultim3.nim
diff --git a/tests/run/tmultim4.nim b/tests/method/tmultim4.nim
similarity index 100%
rename from tests/run/tmultim4.nim
rename to tests/method/tmultim4.nim
diff --git a/tests/run/tmultim6.nim b/tests/method/tmultim6.nim
similarity index 100%
rename from tests/run/tmultim6.nim
rename to tests/method/tmultim6.nim
diff --git a/tests/run/tsimmeth.nim b/tests/method/tsimmeth.nim
similarity index 100%
rename from tests/run/tsimmeth.nim
rename to tests/method/tsimmeth.nim
diff --git a/tests/reject/mopaque.nim b/tests/module/mopaque.nim
similarity index 100%
rename from tests/reject/mopaque.nim
rename to tests/module/mopaque.nim
diff --git a/tests/compile/mrecmod.nim b/tests/module/mrecmod.nim
similarity index 100%
rename from tests/compile/mrecmod.nim
rename to tests/module/mrecmod.nim
diff --git a/tests/compile/mrecmod2.nim b/tests/module/mrecmod2.nim
similarity index 100%
rename from tests/compile/mrecmod2.nim
rename to tests/module/mrecmod2.nim
diff --git a/tests/reject/topaque.nim b/tests/module/topaque.nim
similarity index 100%
rename from tests/reject/topaque.nim
rename to tests/module/topaque.nim
diff --git a/tests/reject/trecinca.nim b/tests/module/trecinca.nim
similarity index 100%
rename from tests/reject/trecinca.nim
rename to tests/module/trecinca.nim
diff --git a/tests/reject/trecincb.nim b/tests/module/trecincb.nim
similarity index 100%
rename from tests/reject/trecincb.nim
rename to tests/module/trecincb.nim
diff --git a/tests/compile/trecmod.nim b/tests/module/trecmod.nim
similarity index 100%
rename from tests/compile/trecmod.nim
rename to tests/module/trecmod.nim
diff --git a/tests/compile/trecmod2.nim b/tests/module/trecmod2.nim
similarity index 100%
rename from tests/compile/trecmod2.nim
rename to tests/module/trecmod2.nim
diff --git a/tests/compile/mexporta.nim b/tests/modules/mexporta.nim
similarity index 100%
rename from tests/compile/mexporta.nim
rename to tests/modules/mexporta.nim
diff --git a/tests/compile/mexportb.nim b/tests/modules/mexportb.nim
similarity index 100%
rename from tests/compile/mexportb.nim
rename to tests/modules/mexportb.nim
diff --git a/tests/compile/texport.nim b/tests/modules/texport.nim
similarity index 100%
rename from tests/compile/texport.nim
rename to tests/modules/texport.nim
diff --git a/tests/reject/timportexcept.nim b/tests/modules/timportexcept.nim
similarity index 100%
rename from tests/reject/timportexcept.nim
rename to tests/modules/timportexcept.nim
diff --git a/tests/reject/tnamedparams.nim b/tests/namedparams/tnamedparams.nim
similarity index 100%
rename from tests/reject/tnamedparams.nim
rename to tests/namedparams/tnamedparams.nim
diff --git a/tests/compile/tnamedparams.nim b/tests/namedparams/tnamedparams2.nim
similarity index 100%
rename from tests/compile/tnamedparams.nim
rename to tests/namedparams/tnamedparams2.nim
diff --git a/tests/reject/mnamspc1.nim b/tests/namspc/mnamspc1.nim
similarity index 100%
rename from tests/reject/mnamspc1.nim
rename to tests/namspc/mnamspc1.nim
diff --git a/tests/reject/mnamspc2.nim b/tests/namspc/mnamspc2.nim
similarity index 100%
rename from tests/reject/mnamspc2.nim
rename to tests/namspc/mnamspc2.nim
diff --git a/tests/reject/tnamspc.nim b/tests/namspc/tnamspc.nim
similarity index 100%
rename from tests/reject/tnamspc.nim
rename to tests/namspc/tnamspc.nim
diff --git a/tests/reject/tnotnil.nim b/tests/notnil/tnotnil.nim
similarity index 100%
rename from tests/reject/tnotnil.nim
rename to tests/notnil/tnotnil.nim
diff --git a/tests/reject/tnotnil1.nim b/tests/notnil/tnotnil1.nim
similarity index 100%
rename from tests/reject/tnotnil1.nim
rename to tests/notnil/tnotnil1.nim
diff --git a/tests/reject/tnotnil2.nim b/tests/notnil/tnotnil2.nim
similarity index 100%
rename from tests/reject/tnotnil2.nim
rename to tests/notnil/tnotnil2.nim
diff --git a/tests/run/tobjconstr.nim b/tests/object/tobjconstr.nim
similarity index 100%
rename from tests/run/tobjconstr.nim
rename to tests/object/tobjconstr.nim
diff --git a/tests/compile/tobjconstr2.nim b/tests/object/tobjconstr2.nim
similarity index 100%
rename from tests/compile/tobjconstr2.nim
rename to tests/object/tobjconstr2.nim
diff --git a/tests/compile/tobjcov.nim b/tests/object/tobjcov.nim
similarity index 100%
rename from tests/compile/tobjcov.nim
rename to tests/object/tobjcov.nim
diff --git a/tests/run/tobject.nim b/tests/object/tobject.nim
similarity index 100%
rename from tests/run/tobject.nim
rename to tests/object/tobject.nim
diff --git a/tests/compile/tobject2.nim b/tests/object/tobject2.nim
similarity index 100%
rename from tests/compile/tobject2.nim
rename to tests/object/tobject2.nim
diff --git a/tests/compile/tobject3.nim b/tests/object/tobject3.nim
similarity index 100%
rename from tests/compile/tobject3.nim
rename to tests/object/tobject3.nim
diff --git a/tests/compile/toop.nim b/tests/object/toop.nim
similarity index 100%
rename from tests/compile/toop.nim
rename to tests/object/toop.nim
diff --git a/tests/run/toop1.nim b/tests/object/toop1.nim
similarity index 100%
rename from tests/run/toop1.nim
rename to tests/object/toop1.nim
diff --git a/tests/compile/tobjects.nim b/tests/objects/tobjects.nim
similarity index 100%
rename from tests/compile/tobjects.nim
rename to tests/objects/tobjects.nim
diff --git a/tests/reject/tadrdisc.nim b/tests/objvariant/tadrdisc.nim
similarity index 100%
rename from tests/reject/tadrdisc.nim
rename to tests/objvariant/tadrdisc.nim
diff --git a/tests/reject/tcheckedfield1.nim b/tests/objvariant/tcheckedfield1.nim
similarity index 100%
rename from tests/reject/tcheckedfield1.nim
rename to tests/objvariant/tcheckedfield1.nim
diff --git a/tests/reject/temptycaseobj.nim b/tests/objvariant/temptycaseobj.nim
similarity index 100%
rename from tests/reject/temptycaseobj.nim
rename to tests/objvariant/temptycaseobj.nim
diff --git a/tests/run/tvariantstack.nim b/tests/objvariant/tvariantstack.nim
similarity index 100%
rename from tests/run/tvariantstack.nim
rename to tests/objvariant/tvariantstack.nim
diff --git a/tests/reject/topena1.nim b/tests/openarray/topena1.nim
similarity index 100%
rename from tests/reject/topena1.nim
rename to tests/openarray/topena1.nim
diff --git a/tests/run/topenarrayrepr.nim b/tests/openarray/topenarrayrepr.nim
similarity index 100%
rename from tests/run/topenarrayrepr.nim
rename to tests/openarray/topenarrayrepr.nim
diff --git a/tests/run/topenlen.nim b/tests/openarray/topenlen.nim
similarity index 100%
rename from tests/run/topenlen.nim
rename to tests/openarray/topenlen.nim
diff --git a/tests/run/tofopr.nim b/tests/operator/tofopr.nim
similarity index 100%
rename from tests/run/tofopr.nim
rename to tests/operator/tofopr.nim
diff --git a/tests/run/toprprec.nim b/tests/operator/toprprec.nim
similarity index 100%
rename from tests/run/toprprec.nim
rename to tests/operator/toprprec.nim
diff --git a/tests/run/tprecedence.nim b/tests/operator/tprecedence.nim
similarity index 100%
rename from tests/run/tprecedence.nim
rename to tests/operator/tprecedence.nim
diff --git a/tests/run/toverflw.nim b/tests/overflw/toverflw.nim
similarity index 100%
rename from tests/run/toverflw.nim
rename to tests/overflw/toverflw.nim
diff --git a/tests/run/toverflw2.nim b/tests/overflw/toverflw2.nim
similarity index 100%
rename from tests/run/toverflw2.nim
rename to tests/overflw/toverflw2.nim
diff --git a/tests/run/tovfint.nim b/tests/overflw/tovfint.nim
similarity index 100%
rename from tests/run/tovfint.nim
rename to tests/overflw/tovfint.nim
diff --git a/tests/reject/toverl.nim b/tests/overload/toverl.nim
similarity index 100%
rename from tests/reject/toverl.nim
rename to tests/overload/toverl.nim
diff --git a/tests/run/toverl2.nim b/tests/overload/toverl2.nim
similarity index 100%
rename from tests/run/toverl2.nim
rename to tests/overload/toverl2.nim
diff --git a/tests/run/toverl3.nim b/tests/overload/toverl3.nim
similarity index 100%
rename from tests/run/toverl3.nim
rename to tests/overload/toverl3.nim
diff --git a/tests/compile/toverprc.nim b/tests/overload/toverprc.nim
similarity index 100%
rename from tests/compile/toverprc.nim
rename to tests/overload/toverprc.nim
diff --git a/tests/run/toverwr.nim b/tests/overload/toverwr.nim
similarity index 100%
rename from tests/run/toverwr.nim
rename to tests/overload/toverwr.nim
diff --git a/tests/run/tpatterns.nim b/tests/pattern/tpatterns.nim
similarity index 100%
rename from tests/run/tpatterns.nim
rename to tests/pattern/tpatterns.nim
diff --git a/tests/compile/tuserpragma.nim b/tests/pragma/tuserpragma.nim
similarity index 100%
rename from tests/compile/tuserpragma.nim
rename to tests/pragma/tuserpragma.nim
diff --git a/tests/compile/tpush.nim b/tests/pragmas/tpush.nim
similarity index 100%
rename from tests/compile/tpush.nim
rename to tests/pragmas/tpush.nim
diff --git a/tests/run/tnestprc.nim b/tests/proc/tnestprc.nim
similarity index 100%
rename from tests/run/tnestprc.nim
rename to tests/proc/tnestprc.nim
diff --git a/tests/reject/tprocredef.nim b/tests/proc/tprocredef.nim
similarity index 100%
rename from tests/reject/tprocredef.nim
rename to tests/proc/tprocredef.nim
diff --git a/tests/compile/tgenericprocvar.nim b/tests/procvar/tgenericprocvar.nim
similarity index 100%
rename from tests/compile/tgenericprocvar.nim
rename to tests/procvar/tgenericprocvar.nim
diff --git a/tests/reject/tprocvar.nim b/tests/procvar/tprocvar.nim
similarity index 100%
rename from tests/reject/tprocvar.nim
rename to tests/procvar/tprocvar.nim
diff --git a/tests/run/tprocvar.nim b/tests/procvar/tprocvar2.nim
similarity index 100%
rename from tests/run/tprocvar.nim
rename to tests/procvar/tprocvar2.nim
diff --git a/tests/compile/tprocvars.nim b/tests/procvar/tprocvars.nim
similarity index 100%
rename from tests/compile/tprocvars.nim
rename to tests/procvar/tprocvars.nim
diff --git a/tests/compile/compilehelpers.nim b/tests/range/compilehelpers.nim
similarity index 100%
rename from tests/compile/compilehelpers.nim
rename to tests/range/compilehelpers.nim
diff --git a/tests/run/tbug499771.nim b/tests/range/tbug499771.nim
similarity index 100%
rename from tests/run/tbug499771.nim
rename to tests/range/tbug499771.nim
diff --git a/tests/compile/tcolors.nim b/tests/range/tcolors.nim
similarity index 100%
rename from tests/compile/tcolors.nim
rename to tests/range/tcolors.nim
diff --git a/tests/compile/tmatrix3.nim b/tests/range/tmatrix3.nim
similarity index 100%
rename from tests/compile/tmatrix3.nim
rename to tests/range/tmatrix3.nim
diff --git a/tests/reject/tsubrange.nim b/tests/range/tsubrange.nim
similarity index 100%
rename from tests/reject/tsubrange.nim
rename to tests/range/tsubrange.nim
diff --git a/tests/run/tsubrange2.nim b/tests/range/tsubrange2.nim
similarity index 100%
rename from tests/run/tsubrange2.nim
rename to tests/range/tsubrange2.nim
diff --git a/tests/run/tsubrange.nim b/tests/range/tsubrange3.nim
similarity index 100%
rename from tests/run/tsubrange.nim
rename to tests/range/tsubrange3.nim
diff --git a/tests/reject/99bottles.nim b/tests/reject/99bottles.nim
deleted file mode 100644
index 14904ac0f..000000000
--- a/tests/reject/99bottles.nim
+++ /dev/null
@@ -1 +0,0 @@
-# Test if the compiler detects invalid module names
diff --git a/tests/reject/t99bott.nim b/tests/reject/t99bott.nim
deleted file mode 100644
index d18cb0d5c..000000000
--- a/tests/reject/t99bott.nim
+++ /dev/null
@@ -1,36 +0,0 @@
-discard """
- file: "t99bott.nim"
- line: 26
- errormsg: "cannot evaluate at compile time: bn"
- disabled: false
-"""
-## 99 Bottles of Beer
-## http://www.99-bottles-of-beer.net/
-## Nimrod version
-
-## Author: Philippe Lhoste