1 ;;; test-org-src.el --- tests for org-src.el
3 ;; Copyright (C) 2012, 2013 Le Wang
5 ;; Author: Le Wang <l26wang at gmail dot com>
7 ;; This file is not part of GNU Emacs.
9 ;; This program is free software; you can redistribute it and/or modify
10 ;; it under the terms of the GNU General Public License as published by
11 ;; the Free Software Foundation, either version 3 of the License, or
12 ;; (at your option) any later version.
14 ;; This program is distributed in the hope that it will be useful,
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;; GNU General Public License for more details.
19 ;; You should have received a copy of the GNU General Public License
20 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
28 (ert-deftest test-org-src
/basic
()
29 "Editing regular block works. with point on
33 (org-test-with-temp-text
35 #+begin_src emacs-lisp
43 (should (equal (buffer-string) "
44 #+begin_src emacs-lisp
48 (should (equal (word-at-point) "blah"))))
50 (ert-deftest test-org-src
/point-outside-block
()
51 "Editing with point before/after block signals expected error."
52 (org-test-with-temp-text
54 #+begin_src emacs-lisp
59 (should-error (org-edit-special))
60 (goto-char (point-max))
61 (should-error (org-edit-special))))
63 (ert-deftest test-org-src
/empty-block
()
64 "Editing empty block."
65 (org-test-with-temp-text
67 #+begin_src emacs-lisp
74 (should (equal (buffer-string) "
75 #+begin_src emacs-lisp
79 (should (equal (word-at-point) "blah"))))
81 (ert-deftest test-org-src
/blank-line-block
()
82 "Editing block with just a blank line."
83 (org-test-with-temp-text-in-file
85 #+begin_src emacs-lisp
94 (should (equal (buffer-string) "
95 #+begin_src emacs-lisp
100 (provide 'test-org-src
)
101 ;;; test-org-src.el ends here