emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Re: [Babel] Small problem with... previewing


From: Eric Schulte
Subject: Re: [Orgmode] Re: [Babel] Small problem with... previewing
Date: Thu, 14 Oct 2010 17:03:11 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux)

Hi Seb,

Sébastien Vauban <address@hidden> writes:

> Hi Eric,
>
> "Eric Schulte" wrote:
[...]
>> and strapped down with a unit test.
>
> Would you have a bit of time (I don't know exactly what's required), could you
> give information about how you'll write this unit test (using this case as an
> example), where you put it and so on.
>

Certainly,

1) First I setup the testing resources as described in
   testing/README.org in the org-mode repo.

2) I opened lisp/ob-sh.el and then pressed C-u C-M-j which calls
   org-test-jump (to jump to the related test file) with a prefix
   argument (to create the file if it doesn't already exist)
   
   this created the file testing/lisp/test-ob-sh.el and filled it with
   all of the required lisp boilerplate

3) I wrote the following small test in test-ob-sh.el which tests the
   desired behavior.

--8<---------------cut here---------------start------------->8---
(ert-deftest test-ob-sh/dont-insert-spaces-on-expanded-bodies ()
  "Expanded shell bodies should not start with a blank line
unless the body of the tangled block does."
  (should-not (string-match "^[\n\r][\t ]*[\n\r]"
                            (org-babel-expand-body:sh "echo 2" '())))
  (should (string-match "^[\n\r][\t ]*[\n\r]"
                        (org-babel-expand-body:sh "\n\necho 2" '()))))
--8<---------------cut here---------------end--------------->8---

>
> I'de be happy contributing with unit tests as well, later.
>

That would be most welcome, and the ideal form of bug report!

Best -- Eric

>
> Best regards,
>   Seb



reply via email to

[Prev in Thread] Current Thread [Next in Thread]