add testcase
This commit is contained in:
parent
b5f463c3f6
commit
72170b443d
1 changed files with 19 additions and 0 deletions
19
tests/assert/tfailedassert_stacktrace.nim
Normal file
19
tests/assert/tfailedassert_stacktrace.nim
Normal file
|
|
@ -0,0 +1,19 @@
|
||||||
|
discard """
|
||||||
|
output: '''
|
||||||
|
tfailedassert_stacktrace.nim(16) tfailedassert_stacktrace
|
||||||
|
tfailedassert_stacktrace.nim(15) foo
|
||||||
|
system.nim(3777) failedAssertImpl
|
||||||
|
system.nim(3770) raiseAssert
|
||||||
|
system.nim(2817) sysFatal
|
||||||
|
'''
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
proc foo() =
|
||||||
|
assert(false)
|
||||||
|
foo()
|
||||||
|
except AssertionError:
|
||||||
|
let e = getCurrentException()
|
||||||
|
echo e.getStackTrace
|
||||||
Loading…
Add table
Add a link
Reference in a new issue