all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Christian Ohler <ohler@gnu.org>
Cc: "Gerd Möllmann" <gerd.moellmann@gmail.com>, 67862@debbugs.gnu.org
Subject: bug#67862: 30.0.50; Handler-bind and ert-test-error-debug
Date: Tue, 26 Dec 2023 11:25:22 -0500	[thread overview]
Message-ID: <jwvo7edhr97.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <m2ttoh5ngn.fsf@Pro.fritz.box> ("Gerd Möllmann"'s message of "Sun, 17 Dec 2023 07:53:44 +0100")

>>     (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"))
>     
OK, so now I understand how that test succeeds, but instead I don't
understand why it is expected to succeed or more specifically what it is
intended to test.

AFAICT

            (let ((ert-debug-on-error t))
              (ert-run-test test))

is supposed to say "run the test and please pop up a debugger if there's
an error".  The ERT code even goes to the trouble to store&use the value of
`ert-debug-on-error` upon entry to the tests rather the value that
happens to be current when the error is signaled.

So to me the code looks like it wants to test that `ert-debug-on-error`
indeed brings up a debugger, tho none of the surrounding code tries to
detect whether the debugger is/was entered, and instead that surrounding
code uses `condition-case` which prevents entering the debugger.

Is it really the purpose of this test to make sure that "even if we ask
for the debugger, `condition-case` prevents the use of a debugger"?


        Stefan






  parent reply	other threads:[~2023-12-26 16:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-17  0:37 bug#67862: 30.0.50; Handler-bind and ert-test-error-debug Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-17  6:53 ` Gerd Möllmann
2023-12-17 15:08   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-12-26 16:25   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2023-12-26 18:00     ` Gerd Möllmann
2023-12-31 19:43       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-01-01  5:56         ` Gerd Möllmann
2024-01-01 12:15           ` Eli Zaretskii
2024-01-01 16:43             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-01 22:27 ` J.P.
2024-02-02  2:46   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-02 23:28     ` J.P.
2024-02-02 23:44       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvo7edhr97.fsf-monnier+emacs@gnu.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=67862@debbugs.gnu.org \
    --cc=gerd.moellmann@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    --cc=ohler@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.