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

  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 \


* 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


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).