about summary refs log tree commit diff
path: root/tests-macro.lisp
blob: df6c43e21d77fed8000384f6db959b6a34bd7a7b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)))))