summary refs log tree commit diff stats
path: root/lib/pure/htmlgen.nim
diff options
context:
space:
mode:
authorOleh Prypin <blaxpirit@gmail.com>2015-04-21 14:37:29 +0300
committerOleh Prypin <blaxpirit@gmail.com>2015-04-21 14:37:29 +0300
commit32109a7867b06cdf9e66ad717f42aebb3e0fcaa4 (patch)
tree6d36a5dfe0007bc7529aeda7acf18bd3c29257ee /lib/pure/htmlgen.nim
parentd203d6fad44547d2291e33712057d154e18c0361 (diff)
downloadNim-32109a7867b06cdf9e66ad717f42aebb3e0fcaa4.tar.gz
Don't run non-test code when defined(testing)
Diffstat (limited to 'lib/pure/htmlgen.nim')
-rw-r--r--lib/pure/htmlgen.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/htmlgen.nim b/lib/pure/htmlgen.nim
index d712e53f3..bffb33b80 100644
--- a/lib/pure/htmlgen.nim
+++ b/lib/pure/htmlgen.nim
@@ -482,7 +482,7 @@ macro `var`*(e: expr): expr {.immediate.} =
   let e = callsite()
   result = xmlCheckedTag(e, "var", commonAttr)
 
-when isMainModule:
+when not defined(testing) and isMainModule:
   var nim = "Nim"
   echo h1(a(href="http://nim-lang.org", nim))
   echo form(action="test", `accept-charset` = "Content-Type")