From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: Re: [Babel] Small problem with... previewing Date: Thu, 14 Oct 2010 17:03:11 -0600 Message-ID: <87r5fs8jio.fsf@gmail.com> References: <80mxqirxf1.fsf@mundaneum.com> <87mxqinmff.fsf@gmail.com> <804ocpm003.fsf_-_@mundaneum.com> <87sk08g8sp.fsf@gmail.com> <808w20lt7m.fsf@mundaneum.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=52515 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P6Wpa-0002Vl-EK for emacs-orgmode@gnu.org; Thu, 14 Oct 2010 19:03:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P6WpZ-0004g7-8Z for emacs-orgmode@gnu.org; Thu, 14 Oct 2010 19:03:26 -0400 Received: from mail-iw0-f169.google.com ([209.85.214.169]:38542) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P6WpZ-0004g0-4B for emacs-orgmode@gnu.org; Thu, 14 Oct 2010 19:03:25 -0400 Received: by iwn1 with SMTP id 1so224646iwn.0 for ; Thu, 14 Oct 2010 16:03:24 -0700 (PDT) In-Reply-To: <808w20lt7m.fsf@mundaneum.com> (=?utf-8?Q?=22S=C3=A9bastien?= Vauban"'s message of "Thu, 14 Oct 2010 16:55:25 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?utf-8?Q?S=C3=A9bastien?= Vauban Cc: emacs-orgmode@gnu.org Hi Seb, S=C3=A9bastien Vauban 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), coul= d you > give information about how you'll write this unit test (using this case a= s 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) =20=20=20 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