test-org-element: Add new tests for org-element-cache
* testing/lisp/test-org-element.el (test-org-element/cache): Add tests for edits near :end of an element.
This commit is contained in:
parent
4bad221a60
commit
f0c474e659
|
@ -4068,6 +4068,22 @@ Text
|
||||||
(should (eq 'example-block (org-element-type (org-element-at-point))))
|
(should (eq 'example-block (org-element-type (org-element-at-point))))
|
||||||
(re-search-forward "END_")
|
(re-search-forward "END_")
|
||||||
(org-element-type (org-element-at-point))))))
|
(org-element-type (org-element-at-point))))))
|
||||||
|
;; Test edits near :end of element
|
||||||
|
(should-not (eq 'headline
|
||||||
|
(org-test-with-temp-text "* H1\nP1\n<point>*H2\n"
|
||||||
|
(org-element-cache-map #'ignore :granularity 'element)
|
||||||
|
(insert "Blah")
|
||||||
|
(org-element-type (org-element-at-point)))))
|
||||||
|
(should-not (eq 'headline
|
||||||
|
(org-test-with-temp-text "* H1\nP1\n<point>*H2\n"
|
||||||
|
(org-element-cache-map #'ignore :granularity 'element)
|
||||||
|
(backward-delete-char 1)
|
||||||
|
(org-element-type (org-element-at-point)))))
|
||||||
|
(should (eq 'headline
|
||||||
|
(org-test-with-temp-text "* H1\nP1\n<point*H2\n"
|
||||||
|
(org-element-cache-map #'ignore :granularity 'element)
|
||||||
|
(insert "Blah\n")
|
||||||
|
(org-element-type (org-element-at-point)))))
|
||||||
;; Corner case: watch out drawers named "PROPERTIES" as they are
|
;; Corner case: watch out drawers named "PROPERTIES" as they are
|
||||||
;; fragile, unlike to other drawers.
|
;; fragile, unlike to other drawers.
|
||||||
(should
|
(should
|
||||||
|
|
Loading…
Reference in New Issue