'assert' is now implemented without compiler magic

This commit is contained in:
Araq
2011-12-04 20:14:50 +01:00
parent 728328eec2
commit 70cf34cbdc
16 changed files with 66 additions and 24 deletions

14
tests/run/tuserassert.nim Normal file
View 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)