emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: [PATCH] Replace `org-ctrl-c-ctrl-c' by `org-babel-execute-maybe' in tests
Date: Fri, 23 Jan 2015 16:05:26 +0100	[thread overview]
Message-ID: <861tmlmtah.fsf@example.com> (raw)
In-Reply-To: 871tnc875r.fsf@nicolasgoaziou.fr

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

Nicolas Goaziou wrote:
> Sebastien Vauban writes:
>
>>> Could you use git format-patch instead?
>>
>> Of course.  Sorry.  Here it is.
>
> I still cannot apply it. It may be related to a whitespace change in
> "test-ob.el":
>
>   Application : Replace `org-ctrl-c-ctrl-c' by `org-babel-execute-maybe' in tests
>   error: le patch a échoué : testing/lisp/test-ob.el:269
>   error: testing/lisp/test-ob.el : le patch ne s'applique pas

Attached a patch that I certify working -- I've applied it myself with
success on a current master clone.

I still don't understand why the previous one did not work (SPC vs TAB
or something like that, same guess as you).

Best regards,
  Seb

-- 
Sebastien Vauban

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Replace-org-ctrl-c-ctrl-c-by-org-babel-execute-maybe.patch --]
[-- Type: text/x-patch, Size: 14057 bytes --]

From 82c1f3bc268a856e6d20250c028157ede33528d7 Mon Sep 17 00:00:00 2001
From: Sebastien Vauban <sva-news-D0wtAvR13HarG/iDocfnWg@public.gmane.org>
Date: Fri, 23 Jan 2015 15:47:43 +0100
Subject: [PATCH] Replace `org-ctrl-c-ctrl-c' by `org-babel-execute-maybe'

* testing/lisp/test-ob-emacs-lisp.el, test-ob-ruby.el, test-ob.el: Replace `org-ctrl-c-ctrl-c' by `org-babel-execute-maybe'.
---
 testing/lisp/test-ob-emacs-lisp.el | 10 ++---
 testing/lisp/test-ob-ruby.el       |  8 ++--
 testing/lisp/test-ob.el            | 88 +++++++++++++++++++-------------------
 3 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/testing/lisp/test-ob-emacs-lisp.el b/testing/lisp/test-ob-emacs-lisp.el
index f771ee3..37d52a6 100644
--- a/testing/lisp/test-ob-emacs-lisp.el
+++ b/testing/lisp/test-ob-emacs-lisp.el
@@ -1,6 +1,6 @@
 ;;; test-ob-emacs-lisp.el

-;; Copyright (c) 2012, 2013, 2014 Free Software Foundation, Inc.
+;; Copyright (c) 2012-2015 Free Software Foundation, Inc.
 ;; Authors: Eric Schulte, Martyn Jago

 ;; This file is not part of GNU Emacs.
@@ -29,7 +29,7 @@
 ;;
 #+end_src"
     (org-babel-next-src-block)
-    (org-ctrl-c-ctrl-c)
+    (org-babel-execute-maybe)
     (should (re-search-forward "results:" nil t))
     (forward-line)
     (should
@@ -42,7 +42,7 @@
 #+end_src"

     (org-babel-next-src-block)
-    (org-ctrl-c-ctrl-c)
+    (org-babel-execute-maybe)
     (should (re-search-forward "results:" nil t))
     (forward-line)
     (should
@@ -56,7 +56,7 @@
 ;;
 #+end_src"
     (org-babel-next-src-block)
-    (org-ctrl-c-ctrl-c)
+    (org-babel-execute-maybe)
     (re-search-forward "results" nil t)
     (forward-line)
     (should (string=
@@ -69,7 +69,7 @@
 2;;
 #+end_src"
     (org-babel-next-src-block)
-    (org-ctrl-c-ctrl-c)
+    (org-babel-execute-maybe)
     (re-search-forward "results" nil t)
     (forward-line)
     (should (string=
diff --git a/testing/lisp/test-ob-ruby.el b/testing/lisp/test-ob-ruby.el
index ee7e837..eb5233b 100644
--- a/testing/lisp/test-ob-ruby.el
+++ b/testing/lisp/test-ob-ruby.el
@@ -1,6 +1,6 @@
 ;;; test-ob-ruby.el --- tests for ob-ruby.el

-;; Copyright (c) 2013 Oleh Krehel
+;; Copyright (c) 2013-2015 Oleh Krehel
 ;; Authors: Oleh Krehel

 ;; This program is free software; you can redistribute it and/or modify
@@ -28,7 +28,7 @@ s = \"2\"
 s = \"3\"
 puts s
 #+end_src"
-  (org-ctrl-c-ctrl-c)
+  (org-babel-execute-maybe)
   (substring-no-properties
    (buffer-string)))
 		   "#+begin_src ruby :session :results output
@@ -47,7 +47,7 @@ puts s
 s = \"5\"
 puts s
 #+end_src"
-  (org-ctrl-c-ctrl-c)
+  (org-babel-execute-maybe)
   (substring-no-properties
    (buffer-string)))
 		   "#+begin_src ruby :session :results output
@@ -63,7 +63,7 @@ puts s
     (should (equal (org-test-with-temp-text "#+begin_src ruby :session :results output
 puts s
 #+end_src"
-  (org-ctrl-c-ctrl-c)
+  (org-babel-execute-maybe)
   (substring-no-properties
    (buffer-string)))
 		   "#+begin_src ruby :session :results output
diff --git a/testing/lisp/test-ob.el b/testing/lisp/test-ob.el
index 989c201..1f375ed 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-2014 Eric Schulte
+;; Copyright (c) 2010-2015 Eric Schulte
 ;; Authors: Eric Schulte, Martyn Jago

 ;; This file is not part of GNU Emacs.
@@ -299,18 +299,18 @@ this is simple"
     ;; src_ at bol line 1...
     (org-test-with-temp-text
 	test-line
-      (goto-char (point-min)) (org-ctrl-c-ctrl-c)
+      (goto-char (point-min)) (org-babel-execute-maybe)
       (should (string=
        	       (concat test-line " =1=")
        	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
-      (forward-char) (org-ctrl-c-ctrl-c)
+      (forward-char) (org-babel-execute-maybe)
       (should (string=
        	       (concat test-line " =1= =1=")
        	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
       (re-search-forward "1}")
-      (should-error (org-ctrl-c-ctrl-c))
+      (should-error (org-babel-execute-maybe))
       (backward-char) ;; last char of block body
-      (org-ctrl-c-ctrl-c)
+      (org-babel-execute-maybe)
       (should (string=
        	       (concat test-line " =1= =1= =1=")
        	       (buffer-substring-no-properties (point-at-bol) (point-at-eol)))))
@@ -318,17 +318,17 @@ this is simple"
     (let ((test-line " src_emacs-lisp{ 1 }"))
       (org-test-with-temp-text
 	  test-line
-	(should-error (org-ctrl-c-ctrl-c))
-	(forward-char) (org-ctrl-c-ctrl-c)
+	(should-error (org-babel-execute-maybe))
+	(forward-char) (org-babel-execute-maybe)
 	(should (string=
 		 (concat test-line " =1=")
 		 (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
-	(re-search-forward "{ 1 ") (org-ctrl-c-ctrl-c)
+	(re-search-forward "{ 1 ") (org-babel-execute-maybe)
 	(should (string=
 		 (concat test-line " =1= =1=")
 		 (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
 	(forward-char)
-	(should-error (org-ctrl-c-ctrl-c))))))
+	(should-error (org-babel-execute-maybe))))))

 (ert-deftest test-org-babel/inline-src_blk-default-results-replace-line-2 ()
   ;; src_ at bol line 2...
@@ -336,12 +336,12 @@ this is simple"
 	(org-babel-inline-result-wrap "=%s="))
     (org-test-with-temp-text
 	(concat "\n" test-line)
-      (should-error (org-ctrl-c-ctrl-c))
+      (should-error (org-babel-execute-maybe))
       (goto-char (point-min))
-      (should-error (org-ctrl-c-ctrl-c))
+      (should-error (org-babel-execute-maybe))
       (forward-line)
-      (should-error (org-ctrl-c-ctrl-c))
-      (forward-char) (org-ctrl-c-ctrl-c)
+      (should-error (org-babel-execute-maybe))
+      (forward-char) (org-babel-execute-maybe)
       (should (string=
 	       (concat test-line " =x=")
 	       (buffer-substring-no-properties
@@ -353,28 +353,28 @@ this is simple"
 	test-line
       (goto-char (point-max))
       (insert (concat "\n" test-line " end"))
-      (re-search-backward "src") (org-ctrl-c-ctrl-c)
+      (re-search-backward "src") (org-babel-execute-maybe)
       (should (string=
 	       (concat test-line " =y= end")
 	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
-      (re-search-forward "\" ") (org-ctrl-c-ctrl-c)
+      (re-search-forward "\" ") (org-babel-execute-maybe)
       (should (string=
 	       (concat test-line " =y= =y= end")
 	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
       (forward-char)
-      (should-error (org-ctrl-c-ctrl-c)))))
+      (should-error (org-babel-execute-maybe)))))

 (ert-deftest test-org-babel/inline-src_blk-manual-results-replace ()
   (let ((test-line " src_emacs-lisp[:results replace]{ \"x\" }")
 	(org-babel-inline-result-wrap "=%s="))
     (org-test-with-temp-text
 	(concat "\n" test-line)
-      (should-error (org-ctrl-c-ctrl-c))
+      (should-error (org-babel-execute-maybe))
       (goto-char (point-max))
-      (should-error (org-ctrl-c-ctrl-c))
+      (should-error (org-babel-execute-maybe))
       (beginning-of-line)
-      (should-error (org-ctrl-c-ctrl-c))
-      (forward-char) (org-ctrl-c-ctrl-c)
+      (should-error (org-babel-execute-maybe))
+      (forward-char) (org-babel-execute-maybe)
       (should (string=
       	       (concat test-line " =x=")
       	       (buffer-substring-no-properties
@@ -386,68 +386,68 @@ this is simple"
     (org-test-with-temp-text test-line
       (goto-char (point-max))
       (insert (concat "\n" test-line " end"))
-      (re-search-backward "src") (org-ctrl-c-ctrl-c)
+      (re-search-backward "src") (org-babel-execute-maybe)
       (should (string=
     	       (concat test-line " =y= end")
     	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
-      (re-search-forward "\" ") (org-ctrl-c-ctrl-c)
+      (re-search-forward "\" ") (org-babel-execute-maybe)
       (should (string=
     	       (concat test-line " =y= =y= end")
     	       (buffer-substring-no-properties (point-at-bol) (point-at-eol))))
       (forward-char)
-      (should-error (org-ctrl-c-ctrl-c)))))
+      (should-error (org-babel-execute-maybe)))))

 (ert-deftest test-org-babel/inline-src_blk-results-silent ()
   (let ((test-line "src_emacs-lisp[ :results silent ]{ \"x\" }"))
     (org-test-with-temp-text test-line
-      (org-ctrl-c-ctrl-c)
+      (org-babel-execute-maybe)
       (should (string= test-line
 		       (buffer-substring-no-properties
 			(point-at-bol) (point-at-eol))))
       (end-of-buffer)
-      (should-error (org-ctrl-c-ctrl-c))))
+      (should-error (org-babel-execute-maybe))))
   (let ((test-line (concat " Some text prior to block src_emacs-lisp"
 			   "[ :results silent ]{ \"y\" }")))
     (org-test-with-temp-text
 	test-line
       (goto-char (point-max))
       (insert (concat "\n" test-line " end"))
-      (re-search-backward "src_") (org-ctrl-c-ctrl-c)
+      (re-search-backward "src_") (org-babel-execute-maybe)
       (should (string= (concat test-line " end")
 		       (buffer-substring-no-properties
 			(point-at-bol) (point-at-eol))))
-      (re-search-forward "\" ") (org-ctrl-c-ctrl-c)
+      (re-search-forward "\" ") (org-babel-execute-maybe)
       (should (string= (concat test-line " end")
 		       (buffer-substring-no-properties
 			(point-at-bol) (point-at-eol))))
       (forward-char)
-      (should-error (org-ctrl-c-ctrl-c)))))
+      (should-error (org-babel-execute-maybe)))))

 (ert-deftest test-org-babel/inline-src_blk-results-raw ()
   (let ((test-line "src_emacs-lisp[ :results raw ]{ \"x\" }"))
     (org-test-with-temp-text test-line
-      (org-ctrl-c-ctrl-c)
+      (org-babel-execute-maybe)
       (should (string= (concat test-line " x")
 		       (buffer-string)))))
   (let ((test-line (concat " Some text prior to block "
 			   "src_emacs-lisp[ :results raw ]{ \"the\" }")))
     (org-test-with-temp-text (concat test-line " end")
-      (re-search-forward "src_") (org-ctrl-c-ctrl-c)
+      (re-search-forward "src_") (org-babel-execute-maybe)
       (should (string= (concat test-line " the end")
 		       (buffer-substring-no-properties
 			(point-at-bol) (point-at-eol))))
-      (re-search-forward "\" ") (org-ctrl-c-ctrl-c)
+      (re-search-forward "\" ") (org-babel-execute-maybe)
       (should (string= (concat test-line " the the end")
 		       (buffer-substring-no-properties
 			(point-at-bol) (point-at-eol))))
       (forward-char)
-      (should-error (org-ctrl-c-ctrl-c)))))
+      (should-error (org-babel-execute-maybe)))))

 (ert-deftest test-org-babel/inline-src_blk-results-file ()
   (let ((test-line "src_emacs-lisp[ :results file ]{ \"~/test-file\"  }"))
     (org-test-with-temp-text
 	test-line
-      (org-ctrl-c-ctrl-c)
+      (org-babel-execute-maybe)
       (should (string= (concat test-line " [[file:~/test-file]]")
 		       (buffer-substring-no-properties
 			(point-min) (point-max)))))))
@@ -457,7 +457,7 @@ this is simple"
 	(org-babel-inline-result-wrap "=%s="))
     (org-test-with-temp-text
 	test-line
-      (org-ctrl-c-ctrl-c)
+      (org-babel-execute-maybe)
       (should (string= (concat test-line  " =\"x\"=")
 		       (buffer-substring-no-properties
 			(point-min) (point-max)))))))
@@ -467,7 +467,7 @@ this is simple"
 	(org-babel-inline-result-wrap "=%s="))
     (org-test-with-temp-text
 	test-line
-      (org-ctrl-c-ctrl-c)
+      (org-babel-execute-maybe)
       (should (string= (concat test-line " =\"x\"=")
 		       (buffer-substring-no-properties
 			(point-min) (point-max)))))))
@@ -717,7 +717,7 @@ on two lines
 ;;
 #+end_src"
     (org-babel-next-src-block)
-    (org-ctrl-c-ctrl-c)
+    (org-babel-execute-maybe)
     (should (re-search-forward "\\#\\+results:" nil t))
     (forward-line)
     (should
@@ -729,7 +729,7 @@ on two lines
 \"some text\";;
 #+end_src"
     (org-babel-next-src-block)
-    (org-ctrl-c-ctrl-c)
+    (org-babel-execute-maybe)
     (should (re-search-forward "\\#\\+results:" nil t))
     (forward-line)
     (should
@@ -743,7 +743,7 @@ on two lines
 ;;
 #+end_src"
     (org-babel-next-src-block)
-    (org-ctrl-c-ctrl-c)
+    (org-babel-execute-maybe)
     (re-search-forward "\\#\\+results:" nil t)
     (forward-line)
     (should (string=
@@ -754,7 +754,7 @@ on two lines
 2;;
 #+end_src"
     (org-babel-next-src-block)
-    (org-ctrl-c-ctrl-c)
+    (org-babel-execute-maybe)
     (re-search-forward "\\#\\+results:" nil t)
     (forward-line)
     (should (string=
@@ -770,7 +770,7 @@ The block is actually executed /twice/ to ensure result
 replacement happens correctly."
   (org-test-with-temp-text
       buffer-text
-    (org-babel-next-src-block) (org-ctrl-c-ctrl-c) (org-ctrl-c-ctrl-c)
+    (org-babel-next-src-block) (org-babel-execute-maybe) (org-babel-execute-maybe)
     (should (re-search-forward "\\#\\+results:" nil t))
     (forward-line)
     (should (string= result
@@ -857,7 +857,7 @@ trying to find the :END: marker."
     (org-test-with-temp-text
 	test-line
       (forward-char 1)
-      (org-ctrl-c-ctrl-c)
+      (org-babel-execute-maybe)
       (should (re-search-forward "=\"x\"=" nil t))
       (forward-line))))

@@ -867,7 +867,7 @@ trying to find the :END: marker."
 ;;
 #+end_src"
     (org-babel-next-src-block)
-    (org-ctrl-c-ctrl-c)
+    (org-babel-execute-maybe)
     (re-search-forward "\\#\\+results:" nil t)
     (forward-line)
     (should (string=
@@ -878,7 +878,7 @@ trying to find the :END: marker."
 2;;
 #+end_src"
     (org-babel-next-src-block)
-    (org-ctrl-c-ctrl-c)
+    (org-babel-execute-maybe)
     (re-search-forward "\\#\\+results:" nil t)
     (forward-line)
     (should (string=
@@ -894,7 +894,7 @@ The block is actually executed /twice/ to ensure result
 replacement happens correctly."
   (org-test-with-temp-text
       buffer-text
-    (org-babel-next-src-block) (org-ctrl-c-ctrl-c) (org-ctrl-c-ctrl-c)
+    (org-babel-next-src-block) (org-babel-execute-maybe) (org-babel-execute-maybe)
     (should (re-search-forward "\\#\\+results:" nil t))
     (forward-line)
     (should (string= result
--
2.1.1

  reply	other threads:[~2015-01-23 15:05 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-22 15:45 63 failures for org-test-run-all-tests in an Emacs GUI Sebastien Vauban
2014-12-24  9:53 ` Nicolas Goaziou
2014-12-24 10:33   ` Sebastien Vauban
2014-12-24 12:39     ` Sebastien Vauban
2014-12-24 16:14       ` Nicolas Goaziou
     [not found]         ` <87egrp2ffk.fsf-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org>
2014-12-29 16:06           ` [PATCH] Replace `org-ctrl-c-ctrl-c' by `org-babel-execute-maybe' in tests Sebastien Vauban
2014-12-30  8:53             ` Nicolas Goaziou
2014-12-30 11:32               ` Sebastien Vauban
2014-12-30 21:46                 ` Nicolas Goaziou
     [not found]                   ` <87y4polsjv.fsf-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org>
2014-12-30 23:34                     ` Sebastien Vauban
2015-01-03 10:56                       ` Nicolas Goaziou
2015-01-23 15:05                         ` Sebastien Vauban [this message]
2015-01-23 23:14                           ` Nicolas Goaziou
2015-01-30 13:29                             ` Sebastien Vauban
2015-01-30 17:30                               ` Nicolas Goaziou
2014-12-31  9:25   ` 63 failures for org-test-run-all-tests in an Emacs GUI Sebastien Vauban
2015-01-03 10:57     ` Nicolas Goaziou
2015-01-09 21:01       ` Sebastien Vauban
2015-01-10 10:17         ` Nicolas Goaziou
2015-01-23 15:42           ` Sebastien Vauban
2015-01-23 23:15             ` Nicolas Goaziou
     [not found]               ` <87ppa584wz.fsf-Gpy5sJQTEQHwkn9pgDnJRVAUjnlXr6A1@public.gmane.org>
2015-01-30 14:09                 ` Sebastien Vauban

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=861tmlmtah.fsf@example.com \
    --to=sva-news-d0wtavr13harg/idocfnwg@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).