summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorTimothee Cour <timothee.cour2@gmail.com>2020-07-14 04:14:32 -0700
committerGitHub <noreply@github.com>2020-07-14 13:14:32 +0200
commite07d661d1600989c281a270d90563f1c60392b9d (patch)
treea708cc7b7bedf1473112907e2eb4a89d0ddd7003 /tests
parentffaf4797be4a8e8aec5ada9863ccdec66a066930 (diff)
downloadNim-e07d661d1600989c281a270d90563f1c60392b9d.tar.gz
fix #14475; unittest.require now works with `nim c`; require and check now works with -d:nodejs (#14676)
* fix #14475; make unittest work with -d:nodejs

* fixup

* fixup

* disable inim, delaunay which failed after unittest.require got fixed

* re-enable tests that have been fixed
Diffstat (limited to 'tests')
-rw-r--r--tests/js/tunittest_error.nim2
-rw-r--r--tests/stdlib/tquit.nim2
-rw-r--r--tests/stdlib/tunittest_error.nim22
3 files changed, 25 insertions, 1 deletions
diff --git a/tests/js/tunittest_error.nim b/tests/js/tunittest_error.nim
index ab736bf59..781e34338 100644
--- a/tests/js/tunittest_error.nim
+++ b/tests/js/tunittest_error.nim
@@ -3,6 +3,8 @@ discard """
   outputsub: "[FAILED] with exception"
 """
 
+# see also: `tests/stdlib/tunittest_error.nim`
+
 import unittest
 
 proc ddd() =
diff --git a/tests/stdlib/tquit.nim b/tests/stdlib/tquit.nim
index 1f9283ec4..0b4a479dc 100644
--- a/tests/stdlib/tquit.nim
+++ b/tests/stdlib/tquit.nim
@@ -5,7 +5,7 @@ just exiting...
 joinable: false
 """
 
-# Test the new beforeQuit variable:
+# Test `addQuitProc`
 
 proc myExit() {.noconv.} =
   write(stdout, "just exiting...\n")
diff --git a/tests/stdlib/tunittest_error.nim b/tests/stdlib/tunittest_error.nim
new file mode 100644
index 000000000..7f05ec2a9
--- /dev/null
+++ b/tests/stdlib/tunittest_error.nim
@@ -0,0 +1,22 @@
+discard """
+  exitcode: 1
+  outputsub: "failed: 1 == 3"
+  matrix: "-d:case1; -d:case2"
+  targets: "c js"
+  joinable: false
+"""
+
+when defined case1:
+  import unittest
+  suite "Test":
+    test "test require":
+      check 1==2
+      check 1==3
+
+when defined case2:
+  import unittest
+  suite "Test":
+    test "test require":
+      require 1 == 3
+      if true:
+        quit 0 # intentional