From: Andrea Corallo Date: Sun, 28 Jun 2020 12:45:49 +0000 (+0100) Subject: Add a test to verify CL macro expansion in dynamic scope X-Git-Tag: emacs-28.0.90~2727^2~547 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b8b2982830028303d207d111095e35c90ae6805;p=emacs.git Add a test to verify CL macro expansion in dynamic scope * test/src/comp-tests.el (comp-tests-cl-macro-exp): New test. * test/src/comp-test-funcs-dyn.el: Require `cl-lib'. (comp-tests-cl-macro-exp-f): New function. --- diff --git a/test/src/comp-test-funcs-dyn.el b/test/src/comp-test-funcs-dyn.el index 0e342a39d3e..50a72807be7 100644 --- a/test/src/comp-test-funcs-dyn.el +++ b/test/src/comp-test-funcs-dyn.el @@ -23,6 +23,8 @@ ;;; Code: +(require 'cl-lib) + (defun comp-tests-ffuncall-callee-dyn-f (a b) (list a b)) @@ -35,6 +37,11 @@ (defun comp-tests-ffuncall-callee-opt-rest-dyn-f (a b &optional c &rest d) (list a b c d)) +(defun comp-tests-cl-macro-exp-f () + (cl-loop for xxx in '(a b) + for yyy = xxx + collect xxx)) + (provide 'comp-test-dyn-funcs) ;;; comp-test-funcs-dyn.el ends here diff --git a/test/src/comp-tests.el b/test/src/comp-tests.el index 51586d2f9e8..fe818960dd2 100644 --- a/test/src/comp-tests.el +++ b/test/src/comp-tests.el @@ -574,4 +574,8 @@ https://lists.gnu.org/archive/html/bug-gnu-emacs/2020-03/msg00914.html." (should (equal '(2 . many) (func-arity #'comp-tests-ffuncall-callee-opt-rest-dyn-f)))) +(ert-deftest comp-tests-cl-macro-exp () + "Verify CL macro expansion (bug#42088)." + (should (equal (comp-tests-cl-macro-exp-f) '(a b)))) + ;;; comp-tests.el ends here