tunittesttemplate.nim 294 B

1234567891011121314151617181920212223242526
  1. discard """
  2. exitcode: 1
  3. outputsub: '''
  4. tunittesttemplate.nim(20, 12): Check failed: a.b == 2
  5. a.b was 0
  6. [FAILED] 1
  7. '''
  8. """
  9. # bug #6736
  10. import std/unittest
  11. type
  12. A = object
  13. b: int
  14. template t: untyped =
  15. check(a.b == 2)
  16. suite "1":
  17. test "1":
  18. var a = A(b: 0)
  19. t()