diff options
Diffstat (limited to 'tests/run/tuserassert.nim')
-rw-r--r-- | tests/run/tuserassert.nim | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/run/tuserassert.nim b/tests/run/tuserassert.nim new file mode 100644 index 000000000..958da2fe1 --- /dev/null +++ b/tests/run/tuserassert.nim @@ -0,0 +1,14 @@ +discard """ + output: "454 == 45ugh" +""" + +template myAssert(cond: expr) = + when rand(3) < 2: + let c = cond.astToStr + {.warning: "code activated: " & c.} + if not cond: + echo c, "ugh" + + +myAssert(454 == 45) + |