summary refs log tree commit diff stats
path: root/tests/showoff/tquasiquote.nim
diff options
context:
space:
mode:
Diffstat (limited to 'tests/showoff/tquasiquote.nim')
-rw-r--r--tests/showoff/tquasiquote.nim14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/showoff/tquasiquote.nim b/tests/showoff/tquasiquote.nim
new file mode 100644
index 000000000..404712a02
--- /dev/null
+++ b/tests/showoff/tquasiquote.nim
@@ -0,0 +1,14 @@
+discard """
+  outputsub: '''tquasiquote.nim(14, 8): Check failed: 1 > 2'''
+"""
+
+import macros
+
+macro check(ex: untyped): untyped =
+  var info = ex.lineInfo
+  var expString = ex.toStrLit
+  result = quote do:
+    if not `ex`:
+      echo `info`, ": Check failed: ", `expString`
+
+check 1 > 2