summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorZahary Karadjov <zahary@gmail.com>2014-03-16 18:34:37 +0200
committerZahary Karadjov <zahary@gmail.com>2014-03-16 20:42:49 +0200
commit49b0440c47b1f22bf2b84083b0c2b79fb60fdfd5 (patch)
treecc3e9612054ebcad226d0f7bffc3237d62d30005 /tests
parentf0953db3ba59f2e23df2fb7932c672f5020db5fb (diff)
downloadNim-49b0440c47b1f22bf2b84083b0c2b79fb60fdfd5.tar.gz
make some tests green
Diffstat (limited to 'tests')
-rw-r--r--tests/bind/tinvalidbindtypedesc.nim (renamed from tests/bind/tbindtypedesc.nim)0
-rw-r--r--tests/metatype/tstaticparams.nim4
-rw-r--r--tests/metatype/tusertypeclasses.nim6
-rw-r--r--tests/stdlib/tpegs.nim2
-rw-r--r--tests/testament/tester.nim3
-rw-r--r--tests/vm/twrongconst.nim7
-rw-r--r--tests/vm/twrongwhen.nim4
7 files changed, 13 insertions, 13 deletions
diff --git a/tests/bind/tbindtypedesc.nim b/tests/bind/tinvalidbindtypedesc.nim
index d6fbae537..d6fbae537 100644
--- a/tests/bind/tbindtypedesc.nim
+++ b/tests/bind/tinvalidbindtypedesc.nim
diff --git a/tests/metatype/tstaticparams.nim b/tests/metatype/tstaticparams.nim
index d14de7d65..6d7c569e0 100644
--- a/tests/metatype/tstaticparams.nim
+++ b/tests/metatype/tstaticparams.nim
@@ -54,5 +54,5 @@ echo getRows(m)
 type TTest[T: static[int], U: static[int]] = array[0..T*U, int]
 type TTestSub[N: static[int]] = TTest[1, N]
 
-var x: TTestSub[2]
-echo x.high
+var z: TTestSub[2]
+echo z.high
diff --git a/tests/metatype/tusertypeclasses.nim b/tests/metatype/tusertypeclasses.nim
index eb6597e4d..a5d575dbf 100644
--- a/tests/metatype/tusertypeclasses.nim
+++ b/tests/metatype/tusertypeclasses.nim
@@ -26,7 +26,7 @@ foo 10
 foo "test"
 foo(@[TObj(x: 10), TObj(x: 20)])
 
-proc intval(x: int) = discard
+proc intval(x: int): int = 10
 
 # check real and virtual fields
 type
@@ -34,8 +34,8 @@ type
     T.x
     y(T)
     intval T.y
-    let y = intval(T.y)
-    
+    let z = intval(T.y)
+
 proc y(x: TObj): int = 10
 
 proc testFoo(x: TFoo) = discard
diff --git a/tests/stdlib/tpegs.nim b/tests/stdlib/tpegs.nim
index 7775091a1..6e488bab4 100644
--- a/tests/stdlib/tpegs.nim
+++ b/tests/stdlib/tpegs.nim
@@ -72,7 +72,7 @@ type
     rule: TNode                   ## the rule that the symbol refers to
   TNode {.final, shallow.} = object
     case kind: TPegKind
-    of pkEmpty..pkWhitespace: discard
+    of pkEmpty..pkWhitespace: nil
     of pkTerminal, pkTerminalIgnoreCase, pkTerminalIgnoreStyle: term: string
     of pkChar, pkGreedyRepChar: ch: char
     of pkCharChoice, pkGreedyRepSet: charChoice: ref set[char]
diff --git a/tests/testament/tester.nim b/tests/testament/tester.nim
index fac97cf2a..d32269ad6 100644
--- a/tests/testament/tester.nim
+++ b/tests/testament/tester.nim
@@ -109,6 +109,7 @@ proc addResult(r: var TResults, test: TTest,
                           expected = expected,
                           given = given)
   r.data.addf("$#\t$#\t$#\t$#", name, expected, given, $success)
+  echo " [", $success, "]"
 
 proc cmpMsgs(r: var TResults, expected, given: TSpec, test: TTest) =
   if strip(expected.msg) notin strip(given.msg):
@@ -146,7 +147,7 @@ proc testSpec(r: var TResults, test: TTest) =
   # major entry point for a single test
   let tname = test.name.addFileExt(".nim")
   inc(r.total)
-  echo extractFilename(tname)
+  stdout.write extractFilename(tname)
   var expected = parseSpec(tname)
   if expected.err == reIgnored:
     r.addResult(test, "", "", reIgnored)
diff --git a/tests/vm/twrongconst.nim b/tests/vm/twrongconst.nim
index e5b8a15bd..5c0c80f9f 100644
--- a/tests/vm/twrongconst.nim
+++ b/tests/vm/twrongconst.nim
@@ -1,10 +1,9 @@
 discard """
-  output: "Error: cannot evaluate at compile time: x"
-  line: 10
+  errormsg: "cannot evaluate at compile time: x"
+  line: 9
 """
 
-var x: array[100, char] 
+var x: array[100, char]
 template Foo : expr = x[42]
 
-
 const myConst = foo
diff --git a/tests/vm/twrongwhen.nim b/tests/vm/twrongwhen.nim
index 085bb6fb6..d67e42883 100644
--- a/tests/vm/twrongwhen.nim
+++ b/tests/vm/twrongwhen.nim
@@ -1,9 +1,9 @@
 discard """
-  output: "Error: cannot evaluate at compile time: x"
+  errormsg: "cannot evaluate at compile time: x"
   line: 7
 """
 
-proc bla(x:int) = 
+proc bla(x:int) =
   when x == 0:
     echo "oops"
   else: