require errormsg to be specified before file.

This commit is contained in:
Arne Döring 2018-11-29 16:07:51 +01:00 • committed by Araq
commit 1105d03644
264 changed files with 305 additions and 623 deletions

View file

@ -1,5 +1,4 @@
discard """
file: "tcontinuexc.nim"
outputsub: "ECcaught"
exitcode: "1"
"""
@ -25,6 +24,3 @@ finally:
echo "caught"
#OUT ECcaught

View file

@ -1,5 +1,4 @@
discard """
file: "tnestedbreak.nim"
output: "1\n2\n3\n4"
"""

View file

@ -1,5 +1,4 @@
discard """
file: "texcsub.nim"
output: "caught!"
"""
# Test inheritance for exception matching:
@ -12,6 +11,3 @@ except:
echo "wtf!?"
#OUT caught!

View file

@ -1,6 +1,6 @@
discard """
file: "tfinally.nim"
output: '''came
output: '''
came
here
3
msg1
@ -59,4 +59,4 @@ try:
except:
echo "except2"
finally:
echo "finally2"
echo "finally2"

View file

@ -1,9 +1,10 @@
discard """
file: "tfinally2.nim"
output: '''A
output: '''
A
B
C
D'''
D
'''
"""
# Test break in try statement:
@ -24,7 +25,4 @@ proc main: int =
finally:
echo("D")
discard main() #OUT ABCD
discard main()

View file

@ -1,7 +1,8 @@
discard """
file: "tfinally3.nim"
outputsub: '''false
Within finally->try'''
outputsub: '''
false
Within finally->try
'''
exitCode: 1
"""
# Test break in try statement:

View file

@ -1,5 +1,4 @@
discard """
file: "tfinally4.nim"
output: "B1\nA1\n1\nB1\nB2\ncatch\nA1\n1\nB1\nA1\nA2\n2\nB1\nB2\ncatch\nA1\nA2\n0\nB1\nA1\n1\nB1\nB2\nA1\n1\nB1\nA1\nA2\n2\nB1\nB2\nA1\nA2\n3"
"""

View file

@ -1,6 +1,5 @@
discard """
targets: "c cpp"
file: "tnestedreturn.nim"
output: "A\nB\nC\n"
"""

View file

@ -1,5 +1,4 @@
discard """
file: "tnestedreturn2.nim"
outputsub: "Error: unhandled exception: Problem [OSError]"
exitcode: "1"
"""

View file

@ -1,5 +1,4 @@
discard """
file: "treraise.nim"
outputsub: "Error: unhandled exception: bla [ESomeOtherErr]"
exitcode: "1"
"""
@ -19,6 +18,3 @@ except ESomething:
echo("Error happened")
except:
raise

View file

@ -1,7 +1,6 @@
discard """
file: "tunhandledexc.nim"
cmd: "nim $target -d:release $options $file"
outputsub: '''tunhandledexc.nim(16) genErrors
outputsub: '''tunhandledexc.nim(15) genErrors
Error: unhandled exception: bla [ESomeOtherErr]'''
exitcode: "1"
"""

View file

@ -1,5 +1,4 @@
discard """
file: "twrongexc.nim"
outputsub: "Error: unhandled exception: [ValueError]"
exitcode: "1"
"""
@ -7,7 +6,3 @@ try:
raise newException(ValueError, "")
except OverflowError:
echo("Error caught")