emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] [babel] Collection of code block snippets


From: Martyn Jago
Subject: Re: [O] [babel] Collection of code block snippets
Date: Thu, 08 Sep 2011 23:03:59 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (darwin)

Hi Eric

Martyn Jago <address@hidden> writes:

> Hi Eric
>
> Eric Schulte <address@hidden> writes:
>
>> Hi Martyn,
>>
>>>
>>> I have written a few more tests for inline source blocks execution with
>>> org-ctrl-c-ctrl-c (not extensive by any means).
>>
>> Thanks for adding these tests, I get 6 failures all with the same error
>> [1], is that intentional?  If not would you mind taking another look at
>> this patch?

I reverse-engineered my =test-init.el= script using a call to
=org-test-run-batch-tests= and from that worked out why your script was
breaking tests. 

One problem on my system is that emacs was using the wrong org mode
since the newer org location wasn't known about. Also, the languages,
emacs-lisp and sh need to be switched on (I thought emacs-lisp was on by
default)?

Now all tests pass.

My minimised script...

--8<---------------cut here---------------start------------->8---
(let ((org-dir "~/org-mode/"))
  (add-to-list 'load-path (concat org-dir "lisp"))
  (add-to-list 'load-path (concat org-dir "testing"))
  (require 'org-test)
  (setq org-confirm-babel-evaluate nil)
  (org-babel-do-load-languages
   'org-babel-load-languages '((emacs-lisp . t) (sh . t)))
  (org-test-run-batch-tests))
--8<---------------cut here---------------end--------------->8---

Called by...

--8<---------------cut here---------------start------------->8---
emacs -Q -script ~/orgmode/testing/test-init.el
--8<---------------cut here---------------end--------------->8---

Your modified script...

--8<---------------cut here---------------start------------->8---
emacs -Q -batch -L ~/org-mode/lisp ~/org-mode/testing -l org-test.el \
-eval "(progn(setq org-confirm-babel-evaluate nil) \
(org-babel-do-load-languages 'org-babel-load-languages '((emacs-lisp \
. t) (sh . t))))" -f org-test-run-batch-tests
--8<---------------cut here---------------end--------------->8---

I've fixed my typos in test-ob.el below.

Best, Martyn

>From a444094303e48cbb5f4027e83f8dcf60d240204b Mon Sep 17 00:00:00 2001
From: Martyn Jago <address@hidden>
Date: Thu, 8 Sep 2011 22:34:38 +0100
Subject: [PATCH] * testing/lisp/test-ob.el: Fixed typo

---
 testing/lisp/test-ob.el |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index 9735bd8..1f04c5b 100644
--- a/testing/lisp/test-ob.el
+++ b/testing/lisp/test-ob.el
@@ -390,13 +390,13 @@
       (should (string= (concat test-line " [[file:~/test-file]]")
                       (buffer-substring-no-properties (point-min) 
(point-max)))))))
 
-(ert-deftest test-org-babel/inline-src_blk-results-scaler ()
+(ert-deftest test-org-babel/inline-src_blk-results-scalar ()
   (with-temp-buffer
 
-    (let ((test-line "src_emacs-lisp[ :results scaler ]{ \"x\"  }"))
+    (let ((test-line "src_emacs-lisp[ :results scalar ]{ \"x\"  }"))
       (insert test-line)
       (goto-char (point-min)) (org-ctrl-c-ctrl-c)
-      (should (string= (concat test-line " =x=")
+      (should (string= (concat test-line  " =\"x\"=")
                       (buffer-substring-no-properties (point-min) 
(point-max)))))))
 
 (ert-deftest test-org-babel/inline-src_blk-results-verbatim ()
-- 
1.7.3.4


[...]


reply via email to

[Prev in Thread] Current Thread [Next in Thread]