* [proposal] org-test: Embedded self-tests in orgmode files
@ 2013-07-27 18:32 Daniel Hackney
2013-07-27 18:42 ` Nicolas Goaziou
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Hackney @ 2013-07-27 18:32 UTC (permalink / raw)
To: emacs-orgmode
After finding that =fill-paragraph= has regressed again, I threw
together a quick hack to allow for creating unit tests in orgmode. The
result is at [1].
This simply lets you create an org file like so:
#+BEGIN_SRC org
,* Test heading
,#+BEGIN_SRC emacs-lisp
(org-test-def org-test-fill-paragraph
"Test filling paragraphs"
(fill-paragraph))
,#+END_SRC
,** Before :before:
⁁Lorem
Ipsum
,** Expected :expected:
⁁Lorem Ipsum
#+END_SRC
put the point in the source block, hit =C-c C-c= and have it return
#+BEGIN_SRC org
,#+RESULTS:
: t
#+END_SRC
The =⁁= character is =u+2041=, aka =CARET INSERTION POINT=, and notes
where point should be before and after running the code.
My idea is that this code could be refined to generate ERT tests
allowing orgmode to have a unit test suite.
What does everyone think?
P.S. I'm not on the list, so please include me in replies.
[1] https://github.com/haxney/org-test
--
Daniel Hackney
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-07-27 20:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-27 18:32 [proposal] org-test: Embedded self-tests in orgmode files Daniel Hackney
2013-07-27 18:42 ` Nicolas Goaziou
2013-07-27 18:48 ` Daniel Hackney
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).