From: "Eric Schulte" <schulte.eric@gmail.com>
To: "Sébastien Vauban" <wxhgmqzgwmuf@spammotel.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: Re: [Babel] Small problem with... previewing
Date: Thu, 14 Oct 2010 17:03:11 -0600 [thread overview]
Message-ID: <87r5fs8jio.fsf@gmail.com> (raw)
In-Reply-To: <808w20lt7m.fsf@mundaneum.com> ("Sébastien Vauban"'s message of "Thu, 14 Oct 2010 16:55:25 +0200")
Hi Seb,
Sébastien Vauban <wxhgmqzgwmuf@spammotel.com> 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
prev parent reply other threads:[~2010-10-14 23:03 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-13 14:15 [Babel] Small problem with tangling Sébastien Vauban
2010-10-13 15:26 ` Eric Schulte
2010-10-14 7:37 ` Sébastien Vauban
2010-10-14 13:53 ` Eric Schulte
2010-10-14 15:01 ` Sébastien Vauban
2010-10-14 23:17 ` Eric Schulte
2010-10-15 12:40 ` Sébastien Vauban
2010-10-14 12:28 ` [Babel] Small problem with... previewing Sébastien Vauban
2010-10-14 13:53 ` Dan Davison
2010-10-14 14:15 ` Eric Schulte
2010-10-14 14:55 ` Sébastien Vauban
2010-10-14 15:04 ` Dan Davison
2010-10-14 23:03 ` Eric Schulte [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87r5fs8jio.fsf@gmail.com \
--to=schulte.eric@gmail.com \
--cc=emacs-orgmode@gnu.org \
--cc=wxhgmqzgwmuf@spammotel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.