Merge branch 'master' of github.com:Araq/Nimrod

This commit is contained in:
Araq 2012-06-19 22:38:48 +02:00
commit e0092cfae6
54 changed files with 1980 additions and 1251 deletions

View file

@ -1,6 +1,6 @@
discard """
file: "system.nim"
line: 640
line: 678
errormsg: "type mismatch"
"""

66
tests/run/texceptions.nim Normal file
View file

@ -0,0 +1,66 @@
discard """
output: '''
BEFORE
FINALLY
BEFORE
EXCEPT
FINALLY
RECOVER
BEFORE
EXCEPT
FINALLY
'''
"""
echo ""
proc no_expcetion =
try:
echo "BEFORE"
except:
echo "EXCEPT"
raise
finally:
echo "FINALLY"
try: no_expcetion()
except: echo "RECOVER"
echo ""
proc reraise_in_except =
try:
echo "BEFORE"
raise newException(EIO, "")
except EIO:
echo "EXCEPT"
raise
finally:
echo "FINALLY"
try: reraise_in_except()
except: echo "RECOVER"
echo ""
proc return_in_except =
try:
echo "BEFORE"
raise newException(EIO, "")
except:
echo "EXCEPT"
return
finally:
echo "FINALLY"
try: return_in_except()
except: echo "RECOVER"