all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Andreas Röhler" <andreas.roehler@easy-emacs.de>
To: help-gnu-emacs@gnu.org
Subject: Re: Test succeeding only from edebug
Date: Tue, 6 Aug 2024 09:16:25 +0200	[thread overview]
Message-ID: <cb5823e8-b1cc-4902-91ce-54aa3089cec2@easy-emacs.de> (raw)
In-Reply-To: <87a5hqifoq.fsf@web.de>


Am 06.08.24 um 03:49 schrieb Michael Heerdegen via Users list for the 
GNU Emacs text editor:
> 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.
Yes, however, not at stake here.
> Please tell me if that helps to make any progress - else I try to have
> an even closer look tomorrow.
>
>
> Grüße,
>
> Michael.
>

putting a

(sit-for 0.5)

into ar-thing-in-thing seems to solve it.

Thanks again,

Andreas




  reply	other threads:[~2024-08-06  7:16 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
2024-08-06  7:16       ` Andreas Röhler [this message]
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

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

  git send-email \
    --in-reply-to=cb5823e8-b1cc-4902-91ce-54aa3089cec2@easy-emacs.de \
    --to=andreas.roehler@easy-emacs.de \
    --cc=help-gnu-emacs@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.