parent
0d75723f91
commit
6ff8752be5
52 changed files with 464 additions and 324 deletions
|
|
@ -1,22 +1,22 @@
|
|||
discard """
|
||||
file: "tassert.nim"
|
||||
output: "assertion failure!this shall be always written"
|
||||
outputsub: "assertion failure!this shall be always written"
|
||||
"""
|
||||
# test assert and exception handling
|
||||
|
||||
proc callB() = assert(False)
|
||||
proc callA() = callB()
|
||||
proc callC() = callA()
|
||||
|
||||
try:
|
||||
callC()
|
||||
except EAssertionFailed:
|
||||
write(stdout, "assertion failure!")
|
||||
except:
|
||||
write(stdout, "unknown exception!")
|
||||
finally:
|
||||
system.write(stdout, "this shall be always written")
|
||||
|
||||
assert(false) #OUT assertion failure!this shall be always written
|
||||
# test assert and exception handling
|
||||
|
||||
proc callB() = assert(False)
|
||||
proc callA() = callB()
|
||||
proc callC() = callA()
|
||||
|
||||
try:
|
||||
callC()
|
||||
except EAssertionFailed:
|
||||
write(stdout, "assertion failure!")
|
||||
except:
|
||||
write(stdout, "unknown exception!")
|
||||
finally:
|
||||
system.write(stdout, "this shall be always written")
|
||||
|
||||
assert(false) #OUT assertion failure!this shall be always written
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue