emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Michael Brand <michael.ch.brand@gmail.com>
To: Org Mode <emacs-orgmode@gnu.org>
Subject: ERT: body of org-test-with-temp-text-in-file
Date: Fri, 14 Dec 2012 15:05:55 +0100	[thread overview]
Message-ID: <CALn3zojPP+MR=s2G9bCHxq5mgjdk=b3VzzLifvzhgrV73AZPiw@mail.gmail.com> (raw)

Hi all

The doc of org-test-with-temp-text-in-file says

    (org-test-with-temp-text-in-file TEXT &rest BODY)
    Run body in a temporary file buffer with Org-mode as the active mode.

so I thought I can write:

#+BEGIN_SRC emacs-lisp
  (ert-deftest trial/fail ()
    (org-test-with-temp-text-in-file "
  |   |
  "
      (forward-line)
      (should (org-at-table-p))))
#+END_SRC

but this ERT fails, it passes only if I move what I thought is a body
into a progn:

#+BEGIN_SRC emacs-lisp
  (ert-deftest trial/pass ()
    (org-test-with-temp-text-in-file "
  |   |
  "
      (progn
        (forward-line)
        (should (org-at-table-p)))))
#+END_SRC

Is this difference expected? What did I miss?

(Emacs 24.2.1 with yesterday’s release_7.9.2-695-g31d24a)

Michael

             reply	other threads:[~2012-12-14 14:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-14 14:05 Michael Brand [this message]
2012-12-15  8:19 ` ERT: body of org-test-with-temp-text-in-file Bastien
2012-12-15  9:10   ` Michael Brand

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='CALn3zojPP+MR=s2G9bCHxq5mgjdk=b3VzzLifvzhgrV73AZPiw@mail.gmail.com' \
    --to=michael.ch.brand@gmail.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).