\f
-;; Navigation
+;;; Navigation
+ (ert-deftest test-org/beginning-of-line ()
+ "Test `org-beginning-of-line' specifications."
+ ;; Standard test.
+ (should
+ (org-test-with-temp-text "Some text\nSome other text"
+ (progn (org-beginning-of-line) (bolp))))
+ ;; Standard test with `visual-line-mode'.
+ (should-not
+ (org-test-with-temp-text "A long line of text\nSome other text"
+ (progn (visual-line-mode)
+ (forward-char 2)
+ (dotimes (i 1000) (insert "very "))
+ (org-beginning-of-line)
+ (bolp))))
+ ;; At an headline with special movement.
+ (should
+ (org-test-with-temp-text "* TODO Headline"
+ (let ((org-special-ctrl-a/e t))
+ (org-end-of-line)
+ (and (progn (org-beginning-of-line) (looking-at "Headline"))
+ (progn (org-beginning-of-line) (bolp))
+ (progn (org-beginning-of-line) (looking-at "Headline")))))))
+
(ert-deftest test-org/end-of-line ()
"Test `org-end-of-line' specifications."
;; Standard test.