aboutsummaryrefslogtreecommitdiffstats
path: root/test/lisp
diff options
context:
space:
mode:
authorStefan Monnier2024-12-21 11:13:07 -0500
committerStefan Monnier2024-12-21 11:13:40 -0500
commit476426168106dbcee67d8ea667e11ebe80c7aaed (patch)
tree7872441265781cbaf673b9f81235202975fd8d0c /test/lisp
parenta1d08d2c13497937475bf453c66a22a61f4e8631 (diff)
downloademacs-476426168106dbcee67d8ea667e11ebe80c7aaed.tar.gz
emacs-476426168106dbcee67d8ea667e11ebe80c7aaed.zip
(cl-flet, cl-labels): Fix bug#74870
* lisp/emacs-lisp/cl-macs.el (cl-flet, cl-labels): Wrap function bodies in `cl-block`. * test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs--test-flet-block): New test.
Diffstat (limited to 'test/lisp')
-rw-r--r--test/lisp/emacs-lisp/cl-macs-tests.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/cl-macs-tests.el b/test/lisp/emacs-lisp/cl-macs-tests.el
index 4baf5428101..e1a521dca79 100644
--- a/test/lisp/emacs-lisp/cl-macs-tests.el
+++ b/test/lisp/emacs-lisp/cl-macs-tests.el
@@ -718,6 +718,16 @@ collection clause."
718 (f lex-var))))) 718 (f lex-var)))))
719 (should (equal (f nil) 'a))))) 719 (should (equal (f nil) 'a)))))
720 720
721(ert-deftest cl-macs--test-flet-block ()
722 (should (equal (cl-block f1
723 (cl-flet ((f1 (a) (cons (cl-return-from f1 a) 6)))
724 (cons (f1 5) 6)))
725 '(5 . 6)))
726 (should (equal (cl-block f1
727 (cl-labels ((f1 (a) (cons (cl-return-from f1 a) 6)))
728 (cons (f1 7) 8)))
729 '(7 . 8))))
730
721(ert-deftest cl-flet/edebug () 731(ert-deftest cl-flet/edebug ()
722 "Check that we can instrument `cl-flet' forms (bug#65344)." 732 "Check that we can instrument `cl-flet' forms (bug#65344)."
723 (with-temp-buffer 733 (with-temp-buffer