aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2024-02-26 12:33:35 -0500
committerStefan Monnier2024-02-26 12:33:35 -0500
commit25cfccfb8b5bced05d5547f3eabb4d0508a575c8 (patch)
tree10f76a64a474f05a4e867bb0d1280cc9e53e1d8e
parent76fa7f1f2fb7fbc3dcbd0be7928d0ec112e532e7 (diff)
downloademacs-25cfccfb8b5bced05d5547f3eabb4d0508a575c8.tar.gz
emacs-25cfccfb8b5bced05d5547f3eabb4d0508a575c8.zip
(edebug-tests-trivial-comma): Avoid interaction (bug#69406)
* test/lisp/emacs-lisp/edebug-tests.el (edebug-tests-trivial-backquote): Don't use obsolete `edebug-eval-defun`. (edebug-tests-trivial-comma): Use `inhibit-read-only`; don't use obsolete `edebug-eval-defun`; and fix bug#69406 by binding `eval-expression-debug-on-error`.
-rw-r--r--test/lisp/emacs-lisp/edebug-tests.el22
1 files changed, 12 insertions, 10 deletions
diff --git a/test/lisp/emacs-lisp/edebug-tests.el b/test/lisp/emacs-lisp/edebug-tests.el
index 8c0f729dc39..29adbcff947 100644
--- a/test/lisp/emacs-lisp/edebug-tests.el
+++ b/test/lisp/emacs-lisp/edebug-tests.el
@@ -860,8 +860,7 @@ test and possibly others should be updated."
860 (let ((inhibit-read-only t)) 860 (let ((inhibit-read-only t))
861 (delete-region (point-min) (point-max)) 861 (delete-region (point-min) (point-max))
862 (insert "`1")) 862 (insert "`1"))
863 (with-suppressed-warnings ((obsolete edebug-eval-defun)) 863 (eval-defun nil)
864 (edebug-eval-defun nil))
865 ;; `eval-defun' outputs its message to the echo area in a rather 864 ;; `eval-defun' outputs its message to the echo area in a rather
866 ;; funny way, so the "1" and the " (#o1, #x1, ?\C-a)" end up placed 865 ;; funny way, so the "1" and the " (#o1, #x1, ?\C-a)" end up placed
867 ;; there in separate pieces (via `print' rather than via `message'). 866 ;; there in separate pieces (via `print' rather than via `message').
@@ -871,18 +870,21 @@ test and possibly others should be updated."
871 870
872 (setq edebug-initial-mode 'go) 871 (setq edebug-initial-mode 'go)
873 ;; In Bug#23651 Edebug would hang reading `1. 872 ;; In Bug#23651 Edebug would hang reading `1.
874 (with-suppressed-warnings ((obsolete edebug-eval-defun)) 873 (eval-defun t)
875 (edebug-eval-defun t)))) 874 (should (string-match-p (regexp-quote " (#o1, #x1, ?\\C-a)")
875 edebug-tests-messages))))
876 876
877(ert-deftest edebug-tests-trivial-comma () 877(ert-deftest edebug-tests-trivial-comma ()
878 "Edebug can read a trivial comma expression (Bug#23651)." 878 "Edebug can read a trivial comma expression (Bug#23651)."
879 (edebug-tests-with-normal-env 879 (edebug-tests-with-normal-env
880 (read-only-mode -1) 880 (let ((inhibit-read-only t))
881 (delete-region (point-min) (point-max)) 881 (delete-region (point-min) (point-max))
882 (insert ",1") 882 (insert ",1"))
883 (read-only-mode) 883 ;; FIXME: This currently signals a "Source has changed" error, which is
884 (with-suppressed-warnings ((obsolete edebug-eval-defun)) 884 ;; itself a bug (the source hasn't changed). All we're testing here
885 (should-error (edebug-eval-defun t))))) 885 ;; is that the Edebug gets past the step of reading the sexp.
886 (should-error (let ((eval-expression-debug-on-error nil))
887 (eval-defun t)))))
886 888
887(ert-deftest edebug-tests-circular-read-syntax () 889(ert-deftest edebug-tests-circular-read-syntax ()
888 "Edebug can instrument code using circular read object syntax (Bug#23660)." 890 "Edebug can instrument code using circular read object syntax (Bug#23660)."