From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sebastien Vauban" Subject: Re: [babel] Export problem (Wrong type argument: consp, nil) Date: Fri, 16 Sep 2011 12:12:12 +0200 Message-ID: <80litoaj9f.fsf@somewhere.org> References: <80litzcbg1.fsf@somewhere.org> <87hb4ndj1f.fsf@gmail.com> <80y5xrld4x.fsf@somewhere.org> <87wrd9hkfv.fsf@gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" 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 --=-=-= Content-Type: text/plain Hi Eric, Eric Schulte wrote: > Thanks for working on this test, I look forward to adding it once it is > completed. As promised, a patch for checking that vars with no default value will generate an error with a full explanation. I edited 2 files: - lisp/test-ob.el - examples/babel.org Tell me if this is following your expected way of receiving patches. I believe so, but tell me anything that would not have been done correctly... Best regards, Seb -- Sebastien Vauban --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-test-checking-that-any-variable-declared-with-no.patch >From 453c0d5e54544ef5812098817746b4280375f5e4 Mon Sep 17 00:00:00 2001 From: Sebastien Vauban Date: Fri, 16 Sep 2011 12:06:21 +0200 Subject: [PATCH] Add test checking that any variable declared with no default value will generate a proper error message. --- testing/lisp/test-ob.el | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-) diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el index 2e71a59..f78ca98 100644 --- a/testing/lisp/test-ob.el +++ b/testing/lisp/test-ob.el @@ -1,6 +1,6 @@ ;;; test-ob.el --- tests for ob.el -;; Copyright (c) 2010 Eric Schulte +;; Copyright (c) 2010, 2011 Eric Schulte ;; Authors: Eric Schulte, Martyn Jago ;; Released under the GNU General Public License version 3 @@ -421,6 +421,15 @@ (next-result) (should (not (org-babel-in-example-or-verbatim)))))) +(ert-deftest test-org-babel/no-defaut-value-for-var () + "Test that the absence of a default value for a variable DOES THROW + a proper error." + (org-test-at-id "f2df5ba6-75fa-4e6b-8441-65ed84963627" + (org-babel-next-src-block) + (let ((err + (should-error (org-babel-execute-src-block) :type 'error))) + (should (equal '(error "variable \"x\" in block \"carre\" must be assigned a default value") err))))) + (provide 'test-ob) ;;; test-ob ends here -- 1.7.5.1 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Add-test-checking-that-any-variable-declared-with-no.patch >From 3e04371aa9a7afcacf5c26877328a829b8067830 Mon Sep 17 00:00:00 2001 From: Sebastien Vauban Date: Fri, 16 Sep 2011 12:07:19 +0200 Subject: [PATCH] Add test checking that any variable declared with no default value will generate a proper error message. --- testing/examples/babel.org | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/testing/examples/babel.org b/testing/examples/babel.org index b892124..82dd8ee 100644 --- a/testing/examples/babel.org +++ b/testing/examples/babel.org @@ -307,3 +307,16 @@ src_sh{echo 2} blocks on the src_emacs-lisp{"same"} line #+results: [[file:./cv.cls]] + +* no default value for vars + :PROPERTIES: + :ID: f2df5ba6-75fa-4e6b-8441-65ed84963627 + :END: + +There is no default value assigned to =x= variable. This is not permitted +anymore. + +#+source: carre(x) +#+begin_src python + return x*x +#+end_src -- 1.7.5.1 --=-=-=--