From 70cf34cbdcff55771b6936b898fdb87c22af403e Mon Sep 17 00:00:00 2001 From: Araq Date: Sun, 4 Dec 2011 20:14:50 +0100 Subject: 'assert' is now implemented without compiler magic --- tests/run/tuserassert.nim | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/run/tuserassert.nim (limited to 'tests/run/tuserassert.nim') 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) + -- cgit 1.4.1-2-gfad0