Merge branch 'maint'
[org-mode/org-tableheadings.git] / testing / lisp / test-org-inlinetask.el
blob2025f721d6d3d9e1ae56a8c8365ae5fd874b1a5c
1 ;;; test-org-inlinetask.el --- Tests for org-inlinetask.el
3 ;; Copyright (c) Marco Wahl
4 ;; Authors: Marco Wahl
6 ;; This program is free software; you can redistribute it and/or modify
7 ;; it under the terms of the GNU General Public License as published by
8 ;; the Free Software Foundation, either version 3 of the License, or
9 ;; (at your option) any later version.
11 ;; This program is distributed in the hope that it will be useful,
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;; GNU General Public License for more details.
16 ;; You should have received a copy of the GNU General Public License
17 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
19 ;;; Comments:
21 ;; Tests for org-inlinetask.el.
23 ;;; Code:
25 (require 'org-inlinetask)
28 ;;; Test movement
30 (ert-deftest test-org-inlinetask/goto-end ()
31 "Tests around org-inlinetask."
32 ;; Goto end.
33 (should
34 (equal "** H\n***** I\n***** END<point>\nfoo"
35 (let ((org-inlinetask-min-level 5)
36 (org-adapt-indentation t))
37 (org-test-with-temp-text
38 "** H\n<point>***** I\n***** END\nfoo"
39 (org-inlinetask-goto-end)
40 (insert "<point>")
41 (buffer-string)))))
43 ;; Goto end. End is buffer end.
44 (should
45 (equal "** H\n***** I\n***** END<point>"
46 (let ((org-inlinetask-min-level 5)
47 (org-adapt-indentation t))
48 (org-test-with-temp-text
49 "** H\n<point>***** I\n***** END"
50 (org-inlinetask-goto-end)
51 (insert "<point>")
52 (buffer-string)))))
54 ;; Goto end. Starting somewhere.
55 (should
56 (equal "** H\n***** I\n***** END<point>\n***** I\n***** END"
57 (let ((org-inlinetask-min-level 5)
58 (org-adapt-indentation t))
59 (org-test-with-temp-text
60 "** H\n****<point>* I\n***** END\n***** I\n***** END"
61 (org-inlinetask-goto-end)
62 (insert "<point>")
63 (buffer-string))))))
65 (provide 'test-org-inlinetask)
67 ;;; test-org-inlinetask.el ends here