summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorflywind <xzsflywind@gmail.com>2021-04-06 22:21:58 +0800
committerGitHub <noreply@github.com>2021-04-06 16:21:58 +0200
commitc7b4639460dd377ee937e3468df9b7041744302f (patch)
tree190da0bc3fe40f203110328e268bf649ab627c39 /tests
parent7bfb9f00022513c2d0f4f93799c07be7e9ffa1e6 (diff)
downloadNim-c7b4639460dd377ee937e3468df9b7041744302f.tar.gz
ref #14873 (#17644)
* ref #14873

* comment

* Update lib/core/locks.nim
Diffstat (limited to 'tests')
-rw-r--r--tests/stdlib/tlocks.nim6
-rw-r--r--tests/stdlib/uselocks.nim4
2 files changed, 7 insertions, 3 deletions
diff --git a/tests/stdlib/tlocks.nim b/tests/stdlib/tlocks.nim
index e567cfde8..0815c5d01 100644
--- a/tests/stdlib/tlocks.nim
+++ b/tests/stdlib/tlocks.nim
@@ -1,10 +1,10 @@
 discard """
-  output: '''3'''
-  cmd: "nim $target --threads:on $options $file"
+  targets: "c cpp js"
+  matrix: "--threads:on"
 """
 
 #bug #6049
 import uselocks
 
 var m = createMyType[int]()
-echo $m.use()
+doAssert m.use() == 3
diff --git a/tests/stdlib/uselocks.nim b/tests/stdlib/uselocks.nim
index cde9641b2..e9d23f9d9 100644
--- a/tests/stdlib/uselocks.nim
+++ b/tests/stdlib/uselocks.nim
@@ -9,3 +9,7 @@ proc createMyType*[T]: MyType[T] =
 proc use* (m: var MyType): int =
   withLock m.lock:
     result = 3
+
+block:
+  var l: Lock
+  doAssert $l == "()"