From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Hackney Subject: [proposal] org-test: Embedded self-tests in orgmode files Date: Sat, 27 Jul 2013 14:32:04 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:58090) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V39I2-0000Cy-CU for emacs-orgmode@gnu.org; Sat, 27 Jul 2013 14:32:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1V39I1-0002FE-Dr for emacs-orgmode@gnu.org; Sat, 27 Jul 2013 14:32:26 -0400 Received: from mail-oa0-x230.google.com ([2607:f8b0:4003:c02::230]:59928) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1V39I1-0002F5-5k for emacs-orgmode@gnu.org; Sat, 27 Jul 2013 14:32:25 -0400 Received: by mail-oa0-f48.google.com with SMTP id f4so10020175oah.21 for ; Sat, 27 Jul 2013 11:32:24 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org After finding that =3Dfill-paragraph=3D 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: =E2=81=81Lorem Ipsum ,** Expected :expected: =E2=81=81Lorem Ipsum #+END_SRC put the point in the source block, hit =3DC-c C-c=3D and have it return #+BEGIN_SRC org ,#+RESULTS: : t #+END_SRC The =3D=E2=81=81=3D character is =3Du+2041=3D, aka =3DCARET INSERTION POINT= =3D, 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