|
@@ -2581,6 +2581,27 @@ Foo Bar
|
|
|
|
|
|
;;; Mark Region
|
|
|
|
|
|
+(ert-deftest test-org/mark-element ()
|
|
|
+ "Test `org-mark-element' specifications."
|
|
|
+ ;; Mark beginning and end of element.
|
|
|
+ (should
|
|
|
+ (equal '(t t)
|
|
|
+ (org-test-with-temp-text "Para<point>graph"
|
|
|
+ (org-mark-element)
|
|
|
+ (list (bobp) (= (mark) (point-max))))))
|
|
|
+ (should
|
|
|
+ (equal '(t t)
|
|
|
+ (org-test-with-temp-text "P1\n\nPara<point>graph\n\nP2"
|
|
|
+ (org-mark-element)
|
|
|
+ (list (looking-at "Paragraph")
|
|
|
+ (org-with-point-at (mark) (looking-at "P2"))))))
|
|
|
+ ;; Do not set mark past (point-max).
|
|
|
+ (should
|
|
|
+ (org-test-with-temp-text "Para<point>graph"
|
|
|
+ (narrow-to-region 2 6)
|
|
|
+ (org-mark-element)
|
|
|
+ (= 6 (mark)))))
|
|
|
+
|
|
|
(ert-deftest test-org/mark-subtree ()
|
|
|
"Test `org-mark-subtree' specifications."
|
|
|
;; Error when point is before first headline.
|