test-org-element-at-point: Add tests for point outside contents

This commit is contained in:
Ihor Radchenko 2022-01-24 22:54:18 +08:00
parent 2da1046435
commit 26decec006
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 18 additions and 1 deletions

View File

@ -3759,7 +3759,24 @@ Text
(should
(org-test-with-temp-text "* H\n"
(forward-line)
(or (org-element-at-point) t))))
(or (org-element-at-point) t)))
;; Return greater element when ouside contents.
(should
(eq 'drawer
(org-test-with-temp-text
":DRAWER:\ntest\n:EN<point>D:\n"
(org-element-type (org-element-at-point)))))
(should
(eq 'drawer
(org-test-with-temp-text
":DRA<point>WER:\ntest\n:END:\n"
(org-element-type (org-element-at-point)))))
;; Return greater element when at :contents-end.
(should
(eq 'drawer
(org-test-with-temp-text
":DRAWER:\ntest\n<point>:END:\n"
(org-element-type (org-element-at-point))))))
(ert-deftest test-org-element/context ()
"Test `org-element-context' specifications."