summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/edebug-tests.el
diff options
context:
space:
mode:
authorGemini Lasswell <gazally@runbox.com>2018-07-20 21:54:00 -0700
committerGemini Lasswell <gazally@runbox.com>2018-08-01 13:59:49 -0700
commitdf7371b84e9cfbb6e62c3196c2bc588eb934b835 (patch)
tree9321571f27ac46fc4a45856fa4564c6bccc36bac /test/lisp/emacs-lisp/edebug-tests.el
parent22d463ed5ca262e1d8893b115c3f1237485fc7e0 (diff)
downloademacs-df7371b84e9cfbb6e62c3196c2bc588eb934b835.tar.gz
Fix Edebug spec for cl-macrolet (bug#29919)
Add an Edebug matching function for cl-macrolet which keeps track of its bindings and treats them as macros without Edebug specs when found in the body of the expression. * lisp/emacs-lisp/edebug.el (edebug--cl-macrolet-defs): New variable. (edebug-list-form-args): Use it. (edebug--current-cl-macrolet-defs): New variable. (edebug-match-cl-macrolet-expr, edebug-match-cl-macrolet-name) (edebug-match-cl-macrolet-body): New functions. * lisp/emacs-lisp/cl-macs.el (cl-macrolet): Use cl-macrolet-expr for Edebug spec. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-cl-macrolet): New test. * test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el (edebug-test-code-use-cl-macrolet): New function.
Diffstat (limited to 'test/lisp/emacs-lisp/edebug-tests.el')
-rw-r--r--test/lisp/emacs-lisp/edebug-tests.el11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el
index 85f6bd47db2..7d780edf285 100644
--- a/test/lisp/emacs-lisp/edebug-tests.el
+++ b/test/lisp/emacs-lisp/edebug-tests.el
@@ -913,5 +913,16 @@ test and possibly others should be updated."
"g"
(should (equal edebug-tests-@-result 5)))))
+(ert-deftest edebug-tests-cl-macrolet ()
+ "Edebug can instrument `cl-macrolet' expressions. (Bug#29919)"
+ (edebug-tests-with-normal-env
+ (edebug-tests-setup-@ "use-cl-macrolet" '(10) t)
+ (edebug-tests-run-kbd-macro
+ "@ SPC SPC"
+ (edebug-tests-should-be-at "use-cl-macrolet" "func")
+ (edebug-tests-should-match-result-in-messages "+")
+ "g"
+ (should (equal edebug-tests-@-result "The result of applying + to (1 x) is 11")))))
+
(provide 'edebug-tests)
;;; edebug-tests.el ends here