summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/edebug-tests.el
diff options
context:
space:
mode:
authorPhilipp Stephani <phst@google.com>2020-08-02 16:01:47 +0200
committerPhilipp Stephani <phst@google.com>2020-08-02 16:06:41 +0200
commite6eb554b95327549992c3684910921db9181ffb6 (patch)
treed34af948d645331bad7ec177b4d7a69425ea9f85 /test/lisp/emacs-lisp/edebug-tests.el
parent418ea25bbf306c448516ea79c9eaf25b904e62e4 (diff)
downloademacs-e6eb554b95327549992c3684910921db9181ffb6.tar.gz
Don’t generate duplicate symbols for secondary CL methods (Bug#42671)
* lisp/emacs-lisp/edebug.el (edebug-match-cl-generic-method-qualifier): Add matcher for ‘cl-defmethod’ qualifier. * lisp/emacs-lisp/cl-generic.el (cl-defmethod): Use it. * test/lisp/emacs-lisp/edebug-tests.el (edebug-cl-defmethod-qualifier): New unit test.
Diffstat (limited to 'test/lisp/emacs-lisp/edebug-tests.el')
-rw-r--r--test/lisp/emacs-lisp/edebug-tests.el22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el
index 41811c9dc07..89b1f293743 100644
--- a/test/lisp/emacs-lisp/edebug-tests.el
+++ b/test/lisp/emacs-lisp/edebug-tests.el
@@ -938,5 +938,27 @@ test and possibly others should be updated."
"g"
(should (equal edebug-tests-@-result '(0 1))))))
+(ert-deftest edebug-cl-defmethod-qualifier ()
+ "Check that secondary `cl-defmethod' forms don't stomp over
+primary ones (Bug#42671)."
+ (with-temp-buffer
+ (let* ((edebug-all-defs t)
+ (edebug-initial-mode 'Go-nonstop)
+ (defined-symbols ())
+ (edebug-new-definition-function
+ (lambda (def-name)
+ (push def-name defined-symbols)
+ (edebug-new-definition def-name))))
+ (dolist (form '((cl-defmethod edebug-cl-defmethod-qualifier ((_ number)))
+ (cl-defmethod edebug-cl-defmethod-qualifier
+ :around ((_ number)))))
+ (print form (current-buffer)))
+ (eval-buffer)
+ (should
+ (equal
+ defined-symbols
+ (list (intern "edebug-cl-defmethod-qualifier :around ((_ number))")
+ (intern "edebug-cl-defmethod-qualifier ((_ number))")))))))
+
(provide 'edebug-tests)
;;; edebug-tests.el ends here