'assert' is now implemented without compiler magic
This commit is contained in:
parent
728328eec2
commit
70cf34cbdc
16 changed files with 66 additions and 24 deletions
14
tests/run/tuserassert.nim
Normal file
14
tests/run/tuserassert.nim
Normal file
|
|
@ -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)
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue