emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sebastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [babel] Export problem (Wrong type argument: consp, nil)
Date: Fri, 16 Sep 2011 12:12:12 +0200	[thread overview]
Message-ID: <80litoaj9f.fsf@somewhere.org> (raw)
In-Reply-To: 87wrd9hkfv.fsf@gmail.com

[-- Attachment #1: Type: text/plain, Size: 481 bytes --]

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Add-test-checking-that-any-variable-declared-with-no.patch --]
[-- Type: text/x-patch, Size: 1379 bytes --]

From 453c0d5e54544ef5812098817746b4280375f5e4 Mon Sep 17 00:00:00 2001
From: Sebastien Vauban <sva-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
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


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0001-Add-test-checking-that-any-variable-declared-with-no.patch --]
[-- Type: text/x-patch, Size: 957 bytes --]

From 3e04371aa9a7afcacf5c26877328a829b8067830 Mon Sep 17 00:00:00 2001
From: Sebastien Vauban <sva-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
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


  parent reply	other threads:[~2011-09-16 10:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-08 15:15 [babel] Export problem (Wrong type argument: consp, nil) Sebastien Vauban
2011-09-08 17:33 ` Eric Schulte
2011-09-14  8:52   ` Sebastien Vauban
2011-09-14 11:44     ` Martyn Jago
2011-09-15 15:10     ` Eric Schulte
2011-09-16  9:57       ` Sebastien Vauban
2011-09-16 10:12       ` Sebastien Vauban [this message]
2011-09-16 15:25         ` Eric Schulte

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

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=80litoaj9f.fsf@somewhere.org \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).