Initial import
This commit is contained in:
commit
405b86068e
324 changed files with 163599 additions and 0 deletions
19
tests/tassert.nim
Executable file
19
tests/tassert.nim
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
# test assert and exception handling
|
||||
|
||||
import
|
||||
io
|
||||
|
||||
proc callB() = assert(False)
|
||||
proc callA() = callB()
|
||||
proc callC() = callA()
|
||||
|
||||
try:
|
||||
callC()
|
||||
except EAssertionFailed:
|
||||
io.write(stdout, "assertion failure!\n")
|
||||
except:
|
||||
io.write(stdout, "unknown exception!\n")
|
||||
finally:
|
||||
io.write(stdout, "this shall be always written\n")
|
||||
|
||||
assert(false)
|
||||
Loading…
Add table
Add a link
Reference in a new issue