From: Michael Heerdegen via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Test succeeding only from edebug
Date: Tue, 06 Aug 2024 03:49:09 +0200 [thread overview]
Message-ID: <87a5hqifoq.fsf@web.de> (raw)
In-Reply-To: 35e7f181-19e4-407b-acf6-7014b6ce98af@easy-emacs.de
Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
> Here ist the test, which should remove all braces in buffer:
>
> (ert-deftest ar-trim-braced-in-region-test ()
> (ar-test-with-elisp-buffer-point-min
> "{asdf} {asdf} {asdf}"
> (goto-char (point-min))
> (set-mark (point))
> (end-of-line)
> (ar-trim-braced-in-region-atpt)
> (should (eq (char-before) ?f))))
>
> > Or fails compiled and interpreted?
>
> Usually don't compile my stuff.
Ah ok...so there is no error, just the test fails.
In my experience it is so that when something works correctly when
edebugged but not when run normally, very often the code assumes a state
that is only reached after a (or multiple) redisplay operations have
been performed. When edebugging Emacs gets idle in situations when it
is normally not (each time edebug stops).
I'm not sure which part of your code could rely on such an assumption,
I'm too tired atm too study all details. Could be font-locking that has
not yet been performed - if your test makes use of font-lock features.
If adding an explicit (redisplay) call at the end of the buffer setup
in the definition of `ar-test-with-elisp-buffer-point-min' or before the
`should' call helps then this would be it. In case of font-lock you
would then want to call (font-lock-ensure) to force font-locking
explicitly before Emacs gets idle.
Please tell me if that helps to make any progress - else I try to have
an even closer look tomorrow.
Grüße,
Michael.
next prev parent reply other threads:[~2024-08-06 1:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-05 6:41 Test succeeding only from edebug Andreas Röhler
2024-08-05 15:32 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-08-05 16:06 ` Andreas Röhler
2024-08-06 1:49 ` Michael Heerdegen via Users list for the GNU Emacs text editor [this message]
2024-08-06 7:16 ` Andreas Röhler
2024-08-06 14:53 ` Michael Heerdegen via Users list for the GNU Emacs text editor
2024-08-06 18:21 ` Andreas Röhler
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
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87a5hqifoq.fsf@web.de \
--to=help-gnu-emacs@gnu.org \
--cc=michael_heerdegen@web.de \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).