about summary refs log tree commit diff
path: root/tests-macro.lisp
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-01-22T21·38+0000
committerVincent Ambo <tazjin@google.com>2020-01-22T21·38+0000
commit47f60d0996ed57d3a3c00b25ddbd8fea04096f90 (patch)
tree809e91ff493b17ef82e6e0de81e1eb7fbb33ec7b /tests-macro.lisp
Squashed 'third_party/lisp/quasiquote_2/' content from commit cac90875d1
git-subtree-dir: third_party/lisp/quasiquote_2
git-subtree-split: cac90875d1f66e9385e559bfebafe6b7808b0930
Diffstat (limited to 'tests-macro.lisp')
-rw-r--r--tests-macro.lisp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests-macro.lisp b/tests-macro.lisp
new file mode 100644
index 000000000000..df6c43e21d77
--- /dev/null
+++ b/tests-macro.lisp
@@ -0,0 +1,21 @@
+
+(in-package #:quasiquote-2.0-tests)
+
+(in-suite quasiquote-2.0)
+
+(enable-quasiquote-2.0)
+
+(defmacro define-sample-macro (name args &body body)
+  `(defmacro ,name ,args
+     `(sample-thing-to-macroexpand-to
+       ,,@body)))
+
+(define-sample-macro sample-macro-1 (x y)
+  ,x ,y)
+
+(define-sample-macro sample-macro-2 (&body body)
+  ,@body)
+
+(test macro-defined-macroexpansions
+  (is (equal '(sample-thing-to-macroexpand-to a b) (macroexpand-1 '(sample-macro-1 a b))))
+  (is (equal '(sample-thing-to-macroexpand-to a b c) (macroexpand-1 '(sample-macro-2 a b c)))))
\ No newline at end of file