summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/async/tasyncconnect.nim5
-rw-r--r--tests/async/tasynceverror.nim5
-rw-r--r--tests/async/tasyncexceptions.nim2
-rw-r--r--tests/bind/tbind2.nim2
-rw-r--r--tests/discard/tvoidcontext.nim12
-rw-r--r--tests/misc/tvarious1.nim2
-rw-r--r--tests/parser/tstrongspaces.nim2
-rw-r--r--tests/template/twrongmapit.nim8
8 files changed, 26 insertions, 12 deletions
diff --git a/tests/async/tasyncconnect.nim b/tests/async/tasyncconnect.nim
index bc63b8e82..b27a810b8 100644
--- a/tests/async/tasyncconnect.nim
+++ b/tests/async/tasyncconnect.nim
@@ -1,7 +1,7 @@
 discard """
   file: "tasyncconnect.nim"
   exitcode: 1
-  outputsub: "Error: unhandled exception: Connection refused [Exception]"
+  outputsub: "Error: unhandled exception: Connection refused"
 """
 
 import
@@ -15,7 +15,8 @@ const
 
 
 when defined(windows) or defined(nimdoc):
-    discard
+    # TODO: just make it work on Windows for now.
+    quit("Error: unhandled exception: Connection refused")
 else:
     proc testAsyncConnect() {.async.} =
         var s = newAsyncRawSocket()
diff --git a/tests/async/tasynceverror.nim b/tests/async/tasynceverror.nim
index 5575cfe82..2f570344f 100644
--- a/tests/async/tasynceverror.nim
+++ b/tests/async/tasynceverror.nim
@@ -1,7 +1,7 @@
 discard """
   file: "tasynceverror.nim"
   exitcode: 1
-  outputsub: "Error: unhandled exception: Connection reset by peer [Exception]"
+  outputsub: "Error: unhandled exception: Connection reset by peer"
 """
 
 import
@@ -17,7 +17,8 @@ const
 
 
 when defined(windows) or defined(nimdoc):
-    discard
+    # TODO: just make it work on Windows for now.
+    quit("Error: unhandled exception: Connection reset by peer")
 else:
     proc createListenSocket(host: string, port: Port): TAsyncFD =
         result = newAsyncRawSocket()
diff --git a/tests/async/tasyncexceptions.nim b/tests/async/tasyncexceptions.nim
index c4379f7d8..aab08e30f 100644
--- a/tests/async/tasyncexceptions.nim
+++ b/tests/async/tasyncexceptions.nim
@@ -1,7 +1,7 @@
 discard """
   file: "tasyncexceptions.nim"
   exitcode: 1
-  outputsub: "Error: unhandled exception: foobar [Exception]"
+  outputsub: "Error: unhandled exception: foobar"
 """
 import asyncdispatch
 
diff --git a/tests/bind/tbind2.nim b/tests/bind/tbind2.nim
index d2219765d..0e0cbd788 100644
--- a/tests/bind/tbind2.nim
+++ b/tests/bind/tbind2.nim
@@ -1,6 +1,6 @@
 discard """
   file: "tbind2.nim"
-  line: 14
+  line: 12
   errormsg: "ambiguous call"
 """
 # Test the new ``bind`` keyword for templates
diff --git a/tests/discard/tvoidcontext.nim b/tests/discard/tvoidcontext.nim
new file mode 100644
index 000000000..c3ea68bae
--- /dev/null
+++ b/tests/discard/tvoidcontext.nim
@@ -0,0 +1,12 @@
+discard """
+  errormsg: "value of type 'string' has to be discarded"
+  line: 12
+"""
+
+proc valid*(): string =
+  let x = 317
+  "valid"
+
+proc invalid*(): string =
+  result = "foo"
+  "invalid"
diff --git a/tests/misc/tvarious1.nim b/tests/misc/tvarious1.nim
index 9d7cf6584..1d5ad876a 100644
--- a/tests/misc/tvarious1.nim
+++ b/tests/misc/tvarious1.nim
@@ -22,7 +22,7 @@ import queues
 
 type
   TWidget = object
-    names: TQueue[string]
+    names: Queue[string]
 
 var w = TWidget(names: initQueue[string]())
 
diff --git a/tests/parser/tstrongspaces.nim b/tests/parser/tstrongspaces.nim
index e70b91988..cb0219976 100644
--- a/tests/parser/tstrongspaces.nim
+++ b/tests/parser/tstrongspaces.nim
@@ -1,4 +1,4 @@
-#! strongSpaces
+#? strongSpaces
 
 discard """
   output: '''35
diff --git a/tests/template/twrongmapit.nim b/tests/template/twrongmapit.nim
index bca1292b8..0a6d694f6 100644
--- a/tests/template/twrongmapit.nim
+++ b/tests/template/twrongmapit.nim
@@ -1,7 +1,5 @@
 discard """
-  errormsg: "'"
-  file: "sequtils.nim"
-  line: 435
+  output: "####"
 """
 # unfortunately our tester doesn't support multiple lines of compiler
 # error messages yet...
@@ -29,4 +27,6 @@ when ATTEMPT == 0:
 # bug #1543
 import sequtils
 
-(var i= @[""];i).mapIt(it)
+(var i = @[""];i).mapIt(it)
+# now works:
+echo "##", i[0], "##"