Merge pull request #359 from Tass/master

JS unwinding
This commit is contained in:
Araq 2013-03-16 09:45:39 -07:00
commit 5b7df8ed60
5 changed files with 18 additions and 29 deletions

View file

@ -1,6 +1,8 @@
discard """
file: "tfinally.nim"
output: "came here 3"
output: '''came
here
3'''
"""
# Test return in try statement:
@ -9,10 +11,10 @@ proc main: int =
try:
return 1
finally:
stdout.write("came ")
echo("came")
return 2
finally:
stdout.write("here ")
echo("here ")
return 3
echo main() #OUT came here 3

View file

@ -1,6 +1,9 @@
discard """
file: "tfinally2.nim"
output: "ABCD"
output: '''A
B
C
D'''
"""
# Test break in try statement:
@ -11,15 +14,15 @@ proc main: int =
try:
break AB
finally:
stdout.write("A")
stdout.write("skipped")
echo("A")
echo("skipped")
finally:
block B:
stdout.write("B")
stdout.write("skipped")
stdout.write("C")
echo("B")
echo("skipped")
echo("C")
finally:
stdout.writeln("D")
echo("D")
discard main() #OUT ABCD

View file

@ -176,14 +176,10 @@ proc runJsTests(r: var TResults, options: string) =
runSingleTest(r, filename, options & " -d:nodejs", targetJS)
runSingleTest(r, filename, options & " -d:nodejs -d:release", targetJS)
# texceptions, texcpt1, texcsub, tfinally, tfinally2,
# tfinally3
for t in os.walkFiles("tests/js/t*.nim"):
test(t)
test "tests/run/tactiontable"
test "tests/run/tmultim1"
test "tests/run/tmultim3"
test "tests/run/tmultim4"
for testfile in ["texceptions", "texcpt1", "texcsub", "tfinally", "tfinally2", "tfinally3", "tactiontable", "tmultim1", "tmultim3", "tmultim4"]:
test "tests/run/" & testfile & ".nim"
# ------------------------- register special tests here -----------------------
proc runSpecialTests(r: var TResults, options: string) =