Hi Seb,
Sébastien Vauban <[email protected]> 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
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
[email protected]
http://lists.gnu.org/mailman/listinfo/emacs-orgmode