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.