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

Reply via email to