summary refs log tree commit diff stats
path: root/tests/exception/tonraise.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/exception/tonraise.nim')
-rw-r--r--tests/exception/tonraise.nim34
1 files changed, 0 insertions, 34 deletions
diff --git a/tests/exception/tonraise.nim b/tests/exception/tonraise.nim
deleted file mode 100644
index a155f0b8e..000000000
--- a/tests/exception/tonraise.nim
+++ /dev/null
@@ -1,34 +0,0 @@
-discard """
-  output: '''i: 1
-success'''
-"""
-
-type
-  ESomething = object of Exception
-  ESomeOtherErr = object of Exception
-
-proc genErrors(s: string) =
-  if s == "error!":
-    raise newException(ESomething, "Test")
-  else:
-    raise newException(EsomeotherErr, "bla")
-
-proc foo() =
-  var i = 0
-  try:
-    inc i
-    onRaise(proc (e: ref Exception): bool =
-      echo "i: ", i)
-    genErrors("errssor!")
-  except ESomething:
-    echo("ESomething happened")
-  except:
-    echo("Some other error happened")
-
-  # test that raise handler is gone:
-  try:
-    genErrors("error!")
-  except ESomething:
-    echo "success"
-
-foo()