diff options
author | Vincent Ambo <tazjin@google.com> | 2020-01-22T21·38+0000 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-01-22T21·38+0000 |
commit | ce989529baedb471e17757f2789681580d02f65c (patch) | |
tree | 945f5395017b6c099b22833a276769c4d329ff01 /third_party/lisp/quasiquote_2/tests-macro.lisp | |
parent | 64b8e9381c2582ad773fb8a88636d61012c8ebd2 (diff) | |
parent | 47f60d0996ed57d3a3c00b25ddbd8fea04096f90 (diff) |
Merge commit '47f60d0996ed57d3a3c00b25ddbd8fea04096f90' as 'third_party/lisp/quasiquote_2' r/450
Diffstat (limited to 'third_party/lisp/quasiquote_2/tests-macro.lisp')
-rw-r--r-- | third_party/lisp/quasiquote_2/tests-macro.lisp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/third_party/lisp/quasiquote_2/tests-macro.lisp b/third_party/lisp/quasiquote_2/tests-macro.lisp new file mode 100644 index 000000000000..df6c43e21d77 --- /dev/null +++ b/third_party/lisp/quasiquote_2/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 |