t23536.nim 501 B

123456789101112131415161718192021222324252627
  1. discard """
  2. matrix: "--stackTrace:on --excessiveStackTrace:off"
  3. """
  4. const expected = """
  5. wrong trace:
  6. t23536.nim(22) t23536
  7. t23536.nim(17) foo
  8. assertions.nim(41) failedAssertImpl
  9. assertions.nim(36) raiseAssert
  10. fatal.nim(53) sysFatal
  11. """
  12. try:
  13. proc foo = # bug #23536
  14. doAssert false
  15. for i in 0 .. 1:
  16. foo()
  17. except AssertionDefect:
  18. let e = getCurrentException()
  19. let trace = e.getStackTrace
  20. doAssert "wrong trace:\n" & trace == expected