mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-17 16:38:33 +00:00
Added test cases for return in except statements.
This commit is contained in:
20
tests/exception/tnestedreturn2.nim
Normal file
20
tests/exception/tnestedreturn2.nim
Normal file
@@ -0,0 +1,20 @@
|
||||
discard """
|
||||
file: "tnestedreturn.nim"
|
||||
outputsub: "Error: unhandled exception: Problem [EOS]"
|
||||
exitcode: "1"
|
||||
"""
|
||||
|
||||
proc test4() =
|
||||
try:
|
||||
try:
|
||||
raise newException(EOS, "Problem")
|
||||
except EOS:
|
||||
return
|
||||
finally:
|
||||
discard
|
||||
|
||||
# Should cause unhandled exception error,
|
||||
# but could cause segmentation fault if
|
||||
# exceptions are not handled properly.
|
||||
test4()
|
||||
raise newException(EOS, "Problem")
|
||||
Reference in New Issue
Block a user