From: Stefan Monnier Date: Thu, 28 Dec 2023 05:49:39 +0000 (-0500) Subject: emacs-module-tests.el (mod-test-non-local-exit-signal-test): Repair test X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=142c90a6f088a6eea66d6b08d05a5ff70c018aa6;p=emacs.git emacs-module-tests.el (mod-test-non-local-exit-signal-test): Repair test That test relied on `debugger` and `debug-on-signal` in a way that doesn't work with the new ERT code. * test/src/emacs-module-tests.el (mod-test-non-local-exit-signal-test): Use `handler-bind` rather than the debugger. --- diff --git a/test/src/emacs-module-tests.el b/test/src/emacs-module-tests.el index b82d4a36304..fd0647275a0 100644 --- a/test/src/emacs-module-tests.el +++ b/test/src/emacs-module-tests.el @@ -114,15 +114,14 @@ changes." (ert-deftest mod-test-non-local-exit-signal-test () (should-error (mod-test-signal)) - (let (debugger-args backtrace) + (let (handler-err backtrace) (should-error - (let ((debugger (lambda (&rest args) - (setq debugger-args args - backtrace (with-output-to-string (backtrace))) - (cl-incf num-nonmacro-input-events))) - (debug-on-signal t)) + (handler-bind + ((error (lambda (err) + (setq handler-err err + backtrace (with-output-to-string (backtrace)))))) (mod-test-signal))) - (should (equal debugger-args '(error (error . 56)))) + (should (equal handler-err '(error . 56))) (should (string-match-p (rx bol " mod-test-signal()" eol) backtrace))))