mirror of
https://github.com/nim-lang/Nim.git
synced 2026-02-13 06:43:52 +00:00
add testcase
This commit is contained in:
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
|
||||
Reference in New Issue
Block a user