test-org-element/at-point: Add new test

* testing/lisp/test-org-element.el (test-org-element/at-point): Test
when point is not in current buffer.
This commit is contained in:
Ihor Radchenko 2023-05-31 13:14:21 +03:00
parent 9249275738
commit fcde1f779d
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 9 additions and 0 deletions

View File

@ -4202,6 +4202,15 @@ Text
(org-test-with-temp-text "#+BEGIN_CENTER\nA\n#+END_CENTER"
(progn (search-forward "A")
(org-element-type (org-element-at-point))))))
;; Point in other buffer.
(should
(eq 'paragraph
(org-test-with-temp-text "#+BEGIN_CENTER\nA\n#+END_CENTER"
(progn (search-forward "A")
(org-element-type
(let ((mk (point-marker)))
(with-temp-buffer
(org-element-at-point mk))))))))
;; Correctly set `:parent' property.
(should
(eq 'center-block