]> git.eshelyaron.com Git - emacs.git/commitdiff
emacs-module-tests.el (mod-test-non-local-exit-signal-test): Repair test
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 28 Dec 2023 05:49:39 +0000 (00:49 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 4 Jan 2024 21:35:53 +0000 (16:35 -0500)
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.

test/src/emacs-module-tests.el

index b82d4a36304bb3a37553b638b667fff05c0280e7..fd0647275a0b5863e829cb714939c298f39c9533 100644 (file)
@@ -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))))