emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kevin Liu <kevin@nivekuil.com>
To: emacs-orgmode@gnu.org
Subject: nondeterministic org-test-with-temp-text?
Date: Sat, 30 May 2020 06:43:29 -0700	[thread overview]
Message-ID: <874krxpmgu.fsf@nivekuil.com> (raw)

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	other threads:[~2020-05-30 13:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-30 13:43 Kevin Liu [this message]
2020-05-30 16:09 ` nondeterministic org-test-with-temp-text? Nicolas Goaziou
2020-05-31  1:52   ` Kevin Liu
2020-05-31 11:09     ` Nicolas Goaziou
2020-06-03 16:27       ` Kevin Liu
2020-06-03 16:31         ` Kevin Liu
2020-06-03 22:26         ` Nicolas Goaziou
2020-06-03 23:08           ` Kevin Liu
2020-06-04 14:10             ` Nicolas Goaziou

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

  List information: https://www.orgmode.org/

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

  git send-email \
    --in-reply-to=874krxpmgu.fsf@nivekuil.com \
    --to=kevin@nivekuil.com \
    --cc=emacs-orgmode@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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).