mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-30 09:54:49 +00:00
17 lines
339 B
Nim
Executable File
17 lines
339 B
Nim
Executable File
# test assert and exception handling
|
|
|
|
proc callB() = assert(False)
|
|
proc callA() = callB()
|
|
proc callC() = callA()
|
|
|
|
try:
|
|
callC()
|
|
except EAssertionFailed:
|
|
write(stdout, "assertion failure!\n")
|
|
except:
|
|
write(stdout, "unknown exception!\n")
|
|
finally:
|
|
system.write(stdout, "this shall be always written\n")
|
|
|
|
assert(false)
|