summary refs log tree commit diff stats
path: root/tests/stdlib/tstdlib_various.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2021-09-02 12:10:14 +0200
committerGitHub <noreply@github.com>2021-09-02 12:10:14 +0200
commite0ef859130f429df1891e31a85955daa753346b4 (patch)
tree49c680c4e93a321a319e38168dd14483c2a9b71e /tests/stdlib/tstdlib_various.nim
parent72fa5833adac590e3c78e2b774cd33f28827594b (diff)
downloadNim-e0ef859130f429df1891e31a85955daa753346b4.tar.gz
strict effects (#18777)
* fixes #17369
* megatest is green for --cpu:arm64
* docgen output includes more tags/raises
* implemented 'effectsOf' 
* algorithm.nim: uses new effectsOf annotation
* closes #18376
* closes #17475
* closes #13905
* allow effectsOf: [a, b]
* added a test case
* parameters that are not ours cannot be declared as .effectsOf
* documentation
* manual: added the 'sort' example
* bootstrap with the new better options
Diffstat (limited to 'tests/stdlib/tstdlib_various.nim')
-rw-r--r--tests/stdlib/tstdlib_various.nim31
1 files changed, 14 insertions, 17 deletions
diff --git a/tests/stdlib/tstdlib_various.nim b/tests/stdlib/tstdlib_various.nim
index b153fd2ba..bc90d6ef4 100644
--- a/tests/stdlib/tstdlib_various.nim
+++ b/tests/stdlib/tstdlib_various.nim
@@ -20,12 +20,6 @@ Hi Andreas! How do you feel, Rumpf?
 @[0, 2, 1]
 @[0, 1, 2]
 055this should be the casehugh@["(", "+", " 1", " 2", ")"]
-caught a crash!
-caught a crash!
-caught a crash!
-caught a crash!
-caught a crash!
-caught a crash!
 [5]
 [4, 5]
 [3, 4, 5]
@@ -161,18 +155,21 @@ block tropes:
 
 
 block tsegfaults:
-  proc main =
-    try:
-      var x: ptr int
-      echo x[]
+  when not defined(arm64):
+    var crashes = 0
+    proc main =
       try:
-        raise newException(ValueError, "not a crash")
-      except ValueError:
-        discard
-    except NilAccessDefect:
-      echo "caught a crash!"
-  for i in 0..5:
-    main()
+        var x: ptr int
+        echo x[]
+        try:
+          raise newException(ValueError, "not a crash")
+        except ValueError:
+          discard
+      except NilAccessDefect:
+        inc crashes
+    for i in 0..5:
+      main()
+    assert crashes == 6