From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: [babel] Specified colnames Date: Thu, 25 Apr 2013 15:28:56 +0200 Message-ID: <86wqrq4u3r.fsf@somewhere.org> References: <86y5cuxfro.fsf@somewhere.org> <87obdp0ybb.fsf@gmail.com> <86ip3w957l.fsf@somewhere.org> <87fvz0zslt.fsf@gmail.com> <86a9p8928u.fsf@somewhere.org> <871uaffk5g.fsf@gmail.com> <86sj2nv8de.fsf@somewhere.org> <878v4c7pwp.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: 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-mXXj517/zsQ@public.gmane.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Eric, Eric Schulte wrote: > "Sebastien Vauban" writes: >> Eric Schulte wrote: >>> "Sebastien Vauban" writes: >>>> Eric Schulte wrote: >>>>>> Extra question: tested with a sh block, both of the above do work, that is >>>>>> with strings or symbols. Which one is supposed to be better (that is, will be >>>>>> more portable with time), if there is one? >>>>> >>>>> Both will be maintained. The contribution of a test exercising both >>>>> options could provide an extra guarantee of perseverance. This is also >>>>> a good first step towards editing the code. :) >>>> >>>> Here's my trial to do so [...]. >>>> Does this correspond to what you're asking for? >>> >>> Close, could you prepare this as a patch against the current code base? >>> That way I can simply apply it locally and more easily test it. > > See the above, could you prepare this as a patch so that I can more > easily read/use/test it? Here the patch you asked for. Best regards, Seb >From aa7230ff485df5d9775429b53487aefcc7cd911d Mon Sep 17 00:00:00 2001 From: Sebastien Vauban Date: Thu, 25 Apr 2013 15:24:58 +0200 Subject: [PATCH] Test support of explicitly specified colnames * test-ob.el (test-ob/specific-colnames): Add test checking that given column names are well present in the output table. --- testing/lisp/test-ob.el | 32 ++++++++++++++++++++++++++++++++ 1 files changed, 32 insertions(+), 0 deletions(-) diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index bbbfbc4..d51e183 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -1106,6 +1106,38 @@ Paragraph" (widen) (should (should (re-search-forward "^: 3" nil t))))) +(ert-deftest test-ob/specific-colnames () + "Test passing specific column names." + (should + (equal "#+name: input-table +| id | var1 | +|----+------| +| 1 | bar | +| 2 | baz | + +#+begin_src sh :var data=input-table :exports results :colnames '(Rev Author) +echo \"$data\" +#+end_src + +#+results: +| Rev | Author | +|-----+--------| +| 1 | bar | +| 2 | baz | + +" + (org-test-with-temp-text "#+name: input-table +| id | var1 | +|----+------| +| 1 | bar | +| 2 | baz | + +#+begin_src sh :var data=input-table :exports results :colnames '(Rev Author) +echo \"$data\" +#+end_src +" + (org-babel-execute-src-block) + (buffer-string))))) (provide 'test-ob) -- 1.7.9 -- Sebastien Vauban