all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* 25.0.50.1, ert: (should (bolp)) fails in batch-mode
@ 2015-09-18 10:35 Andreas Röhler
  2015-09-18 11:10 ` Nicolas Richard
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Röhler @ 2015-09-18 10:35 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

noticed a form

(should (bolp))

failed in ert test when called in batch-mode, while

(should (eq 0 (current-indentation)))

succeeded.

Any explanation?

See

https://travis-ci.org/emacs-berlin/general-close/builds

Thanks,

Andreas

GNU Emacs 25.0.50.1 (i686-pc-linux-gnu, GTK+ Version 2.24.23) of 2015-08-27



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 25.0.50.1, ert: (should (bolp)) fails in batch-mode
  2015-09-18 10:35 25.0.50.1, ert: (should (bolp)) fails in batch-mode Andreas Röhler
@ 2015-09-18 11:10 ` Nicolas Richard
  2015-09-18 13:51   ` Andreas Röhler
  0 siblings, 1 reply; 10+ messages in thread
From: Nicolas Richard @ 2015-09-18 11:10 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: help-gnu-emacs

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
> noticed a form
>
> (should (bolp))
>
> failed in ert test when called in batch-mode, while
>
> (should (eq 0 (current-indentation)))

This is not about the current position : it only checks that the first
character of the line is not a whitespace character.

-- 
Nico.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 25.0.50.1, ert: (should (bolp)) fails in batch-mode
  2015-09-18 11:10 ` Nicolas Richard
@ 2015-09-18 13:51   ` Andreas Röhler
  2015-09-18 14:09     ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Röhler @ 2015-09-18 13:51 UTC (permalink / raw)
  To: Nicolas Richard; +Cc: help-gnu-emacs


Am 18.09.2015 um 13:10 schrieb Nicolas Richard:
> Andreas Röhler <andreas.roehler@easy-emacs.de> writes:
>> noticed a form
>>
>> (should (bolp))
>>
>> failed in ert test when called in batch-mode, while
>>
>> (should (eq 0 (current-indentation)))
> This is not about the current position : it only checks that the first
> character of the line is not a whitespace character.
>

Okay, thanks.

In this case position is at BOL, why (bolp) fails from batch-mode?
Test succeeds when called interactively.




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 25.0.50.1, ert: (should (bolp)) fails in batch-mode
  2015-09-18 13:51   ` Andreas Röhler
@ 2015-09-18 14:09     ` Eli Zaretskii
  2015-09-19  6:36       ` Andreas Röhler
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2015-09-18 14:09 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Fri, 18 Sep 2015 15:51:11 +0200
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> 
> In this case position is at BOL, why (bolp) fails from batch-mode?
> Test succeeds when called interactively.

Can you show a test case for that?




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 25.0.50.1, ert: (should (bolp)) fails in batch-mode
  2015-09-18 14:09     ` Eli Zaretskii
@ 2015-09-19  6:36       ` Andreas Röhler
  2015-09-19  7:27         ` Tassilo Horn
  2015-09-19  7:28         ` Eli Zaretskii
  0 siblings, 2 replies; 10+ messages in thread
From: Andreas Röhler @ 2015-09-19  6:36 UTC (permalink / raw)
  To: help-gnu-emacs


Am 18.09.2015 um 16:09 schrieb Eli Zaretskii:
>> Date: Fri, 18 Sep 2015 15:51:11 +0200
>> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
>> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
>>
>> In this case position is at BOL, why (bolp) fails from batch-mode?
>> Test succeeds when called interactively.
> Can you show a test case for that?
>
>

It's here:

https://travis-ci.org/emacs-berlin/general-close/builds

For now the failing commit is that before the last one.



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 25.0.50.1, ert: (should (bolp)) fails in batch-mode
  2015-09-19  6:36       ` Andreas Röhler
@ 2015-09-19  7:27         ` Tassilo Horn
  2015-09-19  7:28         ` Eli Zaretskii
  1 sibling, 0 replies; 10+ messages in thread
From: Tassilo Horn @ 2015-09-19  7:27 UTC (permalink / raw)
  To: Andreas Röhler; +Cc: help-gnu-emacs

Andreas Röhler <andreas.roehler@easy-emacs.de> writes:

>>> In this case position is at BOL, why (bolp) fails from batch-mode?
>>> Test succeeds when called interactively.
>> Can you show a test case for that?
>>
>>
>
> It's here:
>
> https://travis-ci.org/emacs-berlin/general-close/builds
>
> For now the failing commit is that before the last one.

This is no test case, it is a build report which also links to you tests
but those are not easily understandable.

Can you provide some minimal and isolated test case which shows the
problem?  Something like:

--8<---------------cut here---------------start------------->8---
(ert-deftest test-bolp ()
  (with-current-buffer (get-buffer "*scratch*")
    (goto-char (point-min))
    (should (bolp))
    (while (not (= 1 (forward-line 1)))
      (should (bolp)))
    (while (not (= -1 (forward-line -1)))
      (should (bolp)))))
--8<---------------cut here---------------end--------------->8---

That succeeds interactively and also in batch-mode.

I guess the problem in your setting is that it depends on your
customization if you end up at BOL in your tests.  Do your tests also
fail in an interactive session with emacs -Q?

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 25.0.50.1, ert: (should (bolp)) fails in batch-mode
  2015-09-19  6:36       ` Andreas Röhler
  2015-09-19  7:27         ` Tassilo Horn
@ 2015-09-19  7:28         ` Eli Zaretskii
  2015-09-19 11:08           ` Andreas Röhler
  1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2015-09-19  7:28 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Sat, 19 Sep 2015 08:36:21 +0200
> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> 
> 
> Am 18.09.2015 um 16:09 schrieb Eli Zaretskii:
> >> Date: Fri, 18 Sep 2015 15:51:11 +0200
> >> From: Andreas Röhler <andreas.roehler@easy-emacs.de>
> >> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
> >>
> >> In this case position is at BOL, why (bolp) fails from batch-mode?
> >> Test succeeds when called interactively.
> > Can you show a test case for that?
> >
> >
> 
> It's here:
> 
> https://travis-ci.org/emacs-berlin/general-close/builds
> 
> For now the failing commit is that before the last one.

Sorry, I cannot make heads or tails out of that.  What I see is diffs
from a commit to some project that's unknown to me; what I asked for
was some simple test case one can run in "emacs -batch" and perhaps
debug it.

Is it possible to show something simpler, please?




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 25.0.50.1, ert: (should (bolp)) fails in batch-mode
  2015-09-19  7:28         ` Eli Zaretskii
@ 2015-09-19 11:08           ` Andreas Röhler
  2015-09-19 20:08             ` Stefan Monnier
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Röhler @ 2015-09-19 11:08 UTC (permalink / raw)
  To: help-gnu-emacs


Am 19.09.2015 um 09:28 schrieb Eli Zaretskii:
>> Date: Sat, 19 Sep 2015 08:36:21 +0200

Assume test fails because

(font-lock-fontify-buffer)

doesn't work in batch-mode.

I.e. current implementation of general-close relies on face here - which 
should be changed.

;;;;;;;

(ert-deftest general-close-python-colon-test-2 ()
   (general-close-test-with-python-buffer
       "class TutorialApp(App):
     def build(self):
         return Button(text=\"Hello!\",
                       background_color=(0, 0, 1, 1)
                       font_size=150)
if __name__ == \"__main__\""
     (font-lock-fontify-buffer)
     (general-close)
     (should (eq (char-before) ?:))
     (should (eq 0 (current-indentation)))))

;;;;;;;

Thanks all!



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 25.0.50.1, ert: (should (bolp)) fails in batch-mode
  2015-09-19 11:08           ` Andreas Röhler
@ 2015-09-19 20:08             ` Stefan Monnier
  2015-09-20  8:21               ` Andreas Röhler
  0 siblings, 1 reply; 10+ messages in thread
From: Stefan Monnier @ 2015-09-19 20:08 UTC (permalink / raw)
  To: help-gnu-emacs

> Assume test fails because
> (font-lock-fontify-buffer)
> doesn't work in batch-mode.

Not sure if it'll help, but you should use font-lock-ensure instead
when available (new in Emacs-25).


        Stefan




^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: 25.0.50.1, ert: (should (bolp)) fails in batch-mode
  2015-09-19 20:08             ` Stefan Monnier
@ 2015-09-20  8:21               ` Andreas Röhler
  0 siblings, 0 replies; 10+ messages in thread
From: Andreas Röhler @ 2015-09-20  8:21 UTC (permalink / raw)
  To: help-gnu-emacs


Am 19.09.2015 um 22:08 schrieb Stefan Monnier:
>> Assume test fails because
>> (font-lock-fontify-buffer)
>> doesn't work in batch-mode.
> Not sure if it'll help, but you should use font-lock-ensure instead
> when available (new in Emacs-25).
>
>
>          Stefan
>
>

Hmm, thx, however: looks redundant to font-lock-fontify-region.

Will make a new thread for that.

BTW the question here is if ert may deal with fontification - seems not.



^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-09-20  8:21 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-18 10:35 25.0.50.1, ert: (should (bolp)) fails in batch-mode Andreas Röhler
2015-09-18 11:10 ` Nicolas Richard
2015-09-18 13:51   ` Andreas Röhler
2015-09-18 14:09     ` Eli Zaretskii
2015-09-19  6:36       ` Andreas Röhler
2015-09-19  7:27         ` Tassilo Horn
2015-09-19  7:28         ` Eli Zaretskii
2015-09-19 11:08           ` Andreas Röhler
2015-09-19 20:08             ` Stefan Monnier
2015-09-20  8:21               ` Andreas Röhler

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.