emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

nondeterministic org-test-with-temp-text?


From: Kevin Liu
Subject: nondeterministic org-test-with-temp-text?
Date: Sat, 30 May 2020 06:43:29 -0700
User-agent: mu4e 1.5.1; emacs 27.0.91

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))))
  (should
   (org-test-with-temp-text "* A\n** B\n\n\n* C"
     (org-overview)
     (org-cycle)
     (org-cycle)
     (org-cycle)
     (org-next-visible-heading 1)
     (and (bolp) (org-at-heading-p)))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]