From 8f3b8ee44c9aad29bf0ccac59616567f9fba9eb8 Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 15 Dec 2012 08:00:30 +0100 Subject: [PATCH 1/2] testing/org-test.el: Fix `org-test-with-temp-text'. * org-test.el (org-test-with-temp-text): No need to kill a temporary buffer. Don't use (prog1 ,@body ...), only expand ,@body. Thanks to Nick Dokos for pointing this. --- testing/org-test.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/org-test.el b/testing/org-test.el index f2555849b..8a4fc1af6 100644 --- a/testing/org-test.el +++ b/testing/org-test.el @@ -201,7 +201,7 @@ otherwise place the point at the beginning of the inserted text." (goto-char ,(match-beginning 0))) `(progn (insert ,inside-text) (goto-char (point-min))))) - (prog1 ,@body (kill-buffer))))) + ,@body))) (def-edebug-spec org-test-with-temp-text (form body)) (defmacro org-test-with-temp-text-in-file (text &rest body) From c0675b478ed4bcdac16cf5349d035a141048cadc Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 15 Dec 2012 08:04:43 +0100 Subject: [PATCH 2/2] test-org-src.el: Fix a test. * lisp/test-org-src.el (test-org-src/blank-line-block): Use `org-test-with-temp-text-in-file' because `org-in-src-block-p' checks against an Org mode text property. Don't check for the word at point. Thanks to Nick Dokos for reporting this failed test. --- testing/lisp/test-org-src.el | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/testing/lisp/test-org-src.el b/testing/lisp/test-org-src.el index 8205fd193..049dd397a 100644 --- a/testing/lisp/test-org-src.el +++ b/testing/lisp/test-org-src.el @@ -80,22 +80,22 @@ (ert-deftest test-org-src/blank-line-block () "Editing block with just a blank line." - (org-test-with-temp-text + (org-test-with-temp-text-in-file " #+begin_src emacs-lisp #+end_src " - (goto-line 3) - (org-edit-special) - (insert "blah") - (org-edit-src-exit) - (should (equal (buffer-string) " + (progn + (goto-line 3) + (org-edit-special) + (insert "blah") + (org-edit-src-exit) + (should (equal (buffer-string) " #+begin_src emacs-lisp blah #+end_src -")) - (should (equal (word-at-point) "blah")))) +"))))) (provide 'test-org-src) ;;; test-org-src.el ends here