1 ;;; test-org-open-at-point.el
3 ;; Copyright (c) Samuel Loury
4 ;; Authors: Samuel Loury
6 ;; Released under the GNU General Public License version 3
7 ;; see: http://www.gnu.org/licenses/gpl-3.0.html
11 ;; Test for the org-open-at-point function
16 (set-buffer (get-buffer-create "test-org-open-at-point.el"))
19 (or load-file-name
(buffer-file-name)))))
21 (defun test-org-open-at-point/goto-fixture
()
22 (find-file-other-window
23 (concat ly-here
"../examples/open-at-point.org"))
24 (set-buffer "open-at-point.org"))
26 (ert-deftest test-org-open-at-point
/bracket-link-inside
()
27 "Test `org-open-at-point' from inside a bracket link."
28 (test-org-open-at-point/goto-fixture
)
29 ;; go inside the bracket link
32 ;; should now be in front of the header
33 (should (equal (point) 2)))
35 (ert-deftest test-org-open-at-point
/plain-link-inside
()
36 "Test `org-open-at-point' from inside a plain link."
37 (test-org-open-at-point/goto-fixture
)
38 ;; go inside the plain link
41 ;; should now be in front of the header
42 (should (equal (point) 2)))
44 (ert-deftest test-org-open-at-point
/bracket-link-before
()
45 "Test `org-open-at-point' from before a bracket link but in the same line."
46 (test-org-open-at-point/goto-fixture
)
47 ;; go before the bracket link
49 (message "point %s" (point))
51 ;; should now be in front of the header
52 (should (equal (point) 2)))
54 (ert-deftest test-org-open-at-point
/plain-link-before
()
55 "Test `org-open-at-point' from before a plain link but in the same line."
56 (test-org-open-at-point/goto-fixture
)
57 ;; go before the plain link
60 ;; should now be in front of the header
61 (should (equal (point) 2)))