emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

feature/native-comp 5b8b298 2/4: Add a test to verify CL macro expansion


From: Andrea Corallo
Subject: feature/native-comp 5b8b298 2/4: Add a test to verify CL macro expansion in dynamic scope
Date: Sun, 28 Jun 2020 10:55:33 -0400 (EDT)

branch: feature/native-comp
commit 5b8b2982830028303d207d111095e35c90ae6805
Author: Andrea Corallo <akrl@sdf.org>
Commit: Andrea Corallo <akrl@sdf.org>

    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.
---
 test/src/comp-test-funcs-dyn.el | 7 +++++++
 test/src/comp-tests.el          | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/test/src/comp-test-funcs-dyn.el b/test/src/comp-test-funcs-dyn.el
index 0e342a3..50a7280 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 51586d2..fe81896 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]