Subject: bug#67862: 30.0.50; Handler-bind and ert-test-error-debug

From: Gerd Möllmann <[email-masked]>
Date: Sun, 17 Dec 2023 07:53:44 +0100

Stefan Monnier <[email-masked]> writes:

>     (ert-deftest ert-test-error-debug ()
>       (let ((test (make-ert-test :body (lambda () (error "Error message")))))
>         (condition-case condition
>             (progn
>               (let ((ert-debug-on-error t))
>                 (ert-run-test test))
>               (cl-assert nil))
>           ((error)
>            (cl-assert (equal condition '(error "Error message")) t)))))
>
> Until now, this test passes just like that, i.e. without entering
> the debugger.  With the new code, this test does enter the debugger.
>
> Can anyone give me a hand figuring out why/how the debugger is not entered
> with the current code?

Could that be from the condition-case that the test puts around the
ert-run-test? Like in

  (condition-case var
      (let ((debug-on-error t))
        (error "error"))
    (error "no debugger"))