summary refs log tree commit diff stats
path: root/tests/assert/tfailedassert_stacktrace.nim
blob: 43171ef6c8b30febcaac74acdc674ac0d4ee1109 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
discard """
  output: '''
tfailedassert_stacktrace.nim(16) tfailedassert_stacktrace
tfailedassert_stacktrace.nim(15) foo
system.nim(3778)         failedAssertImpl
system.nim(3771)         raiseAssert
system.nim(2818)         sysFatal
'''
"""



try:
  proc foo() =
    assert(false)
  foo()
except AssertionError:
  let e = getCurrentException()
  echo e.getStackTrace