Hello,

Kevin Liu <ke...@nivekuil.com> writes:

> I’m trying to add a test (which should fail at the moment, representing
> an org-mode bug), but it seems like each ‘should’ form is actually
> nondeterministic.  The first form returns nil on the first eval and t on
> subsequent evals, its behavior resetting upon any command, and the
> second form does the inverse, returning t on the first eval and nil on
> subsequent evals.
>
> Is this behavior expected?
>
> (ert-deftest test-org/org-next-visible-heading ()
>   (should
>    (org-test-with-temp-text "* A\n** B\n\n\n* C"
>      (org-overview)
>      (org-cycle)
>      (org-cycle)
>      (org-next-visible-heading 1)
>      (and (bolp) (org-at-heading-p))))

You cannot call `org-cycle' consecutively without care, because it
checks `last-command' and `this-command'. You need to fake their values
before calling `org-cycle' again.

Regards,

-- 
Nicolas Goaziou

Reply via email to