tfaileddoassert.nim 348 B

123456789101112131415161718192021
  1. discard """
  2. cmd: "nim $target -d:release $options $file"
  3. output: '''
  4. test1:ok
  5. test2:ok
  6. '''
  7. """
  8. import testhelper
  9. onFailedAssert(msg):
  10. checkMsg(msg, "tfaileddoassert.nim(15, 9) `a == 2` foo", "test1")
  11. var a = 1
  12. doAssert(a == 2, "foo")
  13. onFailedAssert(msg):
  14. checkMsg(msg, "tfaileddoassert.nim(20, 10) `a == 3` ", "test2")
  15. doAssert a == 3