summary refs log blame commit diff stats
path: root/tests/showoff/tquasiquote.nim
blob: df7fccc3337275041f9b7ba53fbf91ff2a0e7dc9 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14













                                                             
discard """
  outputsub: '''tquasiquote.nim(14,8): Check failed: 1 > 2'''
"""

import macros

macro check(ex: expr): stmt =
  var info = ex.lineInfo
  var expString = ex.toStrLit
  result = quote do:
    if not `ex`:
      echo `info`, ": Check failed: ", `expString`

check 1 > 2