summaryrefslogtreecommitdiff
path: root/test/lisp/emacs-lisp/edebug-tests.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2021-02-12 22:53:38 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2021-02-12 22:53:38 -0500
commitca0842347e5437bcaeeded4a7fd55e0e48ed4bad (patch)
tree7d9719864ae41a9a6f31e53ac4dfd8fa2a7e1416 /test/lisp/emacs-lisp/edebug-tests.el
parent626911b704b3f144e9b8dbd187c394ed90e8411c (diff)
downloademacs-ca0842347e5437bcaeeded4a7fd55e0e48ed4bad.tar.gz
emacs-ca0842347e5437bcaeeded4a7fd55e0e48ed4bad.tar.bz2
emacs-ca0842347e5437bcaeeded4a7fd55e0e48ed4bad.zip
Edebug: Make it possible to debug `gv-expander`s in `declare`
Arrange for declarations to be able to specify their own specs via the `edebug-declaration-spec` property. * lisp/emacs-lisp/edebug.el: (edebug--get-declare-spec): New function. (def-declarations): New spec element. (defun, defmacro): Use it in their spec. * lisp/emacs-lisp/gv.el (gv-expander, gv-setter): Set `edebug-declaration-spec`. * test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-gv-expander): New test. * test/lisp/emacs-lisp/edebug-resources/edebug-test-code.el (edebug-test-code-use-gv-expander): New test case.
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 c11bfcf0012..dfe2cb32065 100644
--- a/test/lisp/emacs-lisp/edebug-tests.el
+++ b/test/lisp/emacs-lisp/edebug-tests.el
@@ -959,6 +959,17 @@ primary ones (Bug#42671)."
(edebug-tests-with-normal-env
(edebug-tests-setup-@ "cl-flet1" '(10) t)))
+(ert-deftest edebug-tests-gv-expander ()
+ "Edebug can instrument `gv-expander' expressions."
+ (edebug-tests-with-normal-env
+ (edebug-tests-setup-@ "use-gv-expander" nil t)
+ (should (equal
+ (catch 'text
+ (run-at-time 0 nil
+ (lambda () (throw 'text (buffer-substring (point) (+ (point) 5)))))
+ (eval '(setf (edebug-test-code-use-gv-expander (cons 'a 'b)) 3) t))
+ "(func"))))
+
(ert-deftest edebug-tests-cl-flet ()
"Check that Edebug can instrument `cl-flet' forms without name
clashes (Bug#41853)."