From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] org-babel-goto-named-src-block bugfix and test Date: Tue, 14 Jun 2016 13:46:03 +0200 Message-ID: <87ziqo0z9g.fsf@saiph.selenimh> References: <84bn36k8ro.fsf@gmail.com> <84y468vyyk.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:55389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCmnN-0004Dk-RY for emacs-orgmode@gnu.org; Tue, 14 Jun 2016 07:46:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bCmnL-0004Yz-U2 for emacs-orgmode@gnu.org; Tue, 14 Jun 2016 07:46:12 -0400 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:47772) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bCmnL-0004Ys-Nn for emacs-orgmode@gnu.org; Tue, 14 Jun 2016 07:46:11 -0400 In-Reply-To: <84y468vyyk.fsf@gmail.com> (Marco Wahl's message of "Tue, 14 Jun 2016 12:36:51 +0200") 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" To: Marco Wahl Cc: emacs-orgmode@gnu.org Hello, Marco Wahl writes: > I have no idea for a cleaner implementation of these tests. AFAICS > these tests look good (and also your code.) If someone has a better > idea for the tests they can be changed. I don't. > I would drop test > > #v+ > ;; non-existent name > (should-not > (execute-kbd-macro > "\M-xorg-babel-goto-named-src-block\ndef\n")) > #v- > > because its outcome has nothing to do with the existence of the name > "def" AFAICS. Or maybe replace with > > (should (string= "source-code block `non-existent' not found in this buffer" > (org-babel-goto-named-src-block "non-existent"))) > > +1 for commit! I'm not very keen on having `should' macro in the inner parts of tests, because it makes debugging failing tests harder, but a test is better than nothing. So, all in all, it looks good enough to be pushed. Thank you ! Regards, -- Nicolas Goaziou