|
@@ -694,13 +694,6 @@
|
|
|
(org-meta-return)
|
|
|
(beginning-of-line)
|
|
|
(looking-at "- $")))
|
|
|
- ;; In a drawer and paragraph insert an empty line, in this case above.
|
|
|
- (should
|
|
|
- (org-test-with-temp-text ":MYDRAWER:\na\n:END:"
|
|
|
- (forward-line)
|
|
|
- (org-meta-return)
|
|
|
- (forward-line -1)
|
|
|
- (looking-at "$")))
|
|
|
;; In a drawer and item insert an item, in this case above.
|
|
|
(should
|
|
|
(org-test-with-temp-text ":MYDRAWER:\n- a\n:END:"
|
|
@@ -709,6 +702,37 @@
|
|
|
(beginning-of-line)
|
|
|
(looking-at "- $"))))
|
|
|
|
|
|
+(ert-deftest test-org/insert-heading ()
|
|
|
+ "Test `org-insert-heading' specifications."
|
|
|
+ ;; FIXME: Test coverage is incomplete yet.
|
|
|
+ ;;
|
|
|
+ ;; In an empty buffer, insert a new headline.
|
|
|
+ (should
|
|
|
+ (equal "* "
|
|
|
+ (org-test-with-temp-text ""
|
|
|
+ (org-insert-heading)
|
|
|
+ (buffer-string))))
|
|
|
+ ;; At the beginning of a line, turn it into a headline
|
|
|
+ (should
|
|
|
+ (equal "* P"
|
|
|
+ (org-test-with-temp-text "<point>P"
|
|
|
+ (org-insert-heading)
|
|
|
+ (buffer-string))))
|
|
|
+ ;; In the middle of a line, split the line if allowed, otherwise,
|
|
|
+ ;; insert the headline at its end.
|
|
|
+ (should
|
|
|
+ (equal "Para\n* graph"
|
|
|
+ (org-test-with-temp-text "Para<point>graph"
|
|
|
+ (let ((org-M-RET-may-split-line '((default . t))))
|
|
|
+ (org-insert-heading))
|
|
|
+ (buffer-string))))
|
|
|
+ (should
|
|
|
+ (equal "Paragraph\n* "
|
|
|
+ (org-test-with-temp-text "Para<point>graph"
|
|
|
+ (let ((org-M-RET-may-split-line '((default . nil))))
|
|
|
+ (org-insert-heading))
|
|
|
+ (buffer-string)))))
|
|
|
+
|
|
|
(ert-deftest test-org/insert-todo-heading-respect-content ()
|
|
|
"Test `org-insert-todo-heading-respect-content' specifications."
|
|
|
;; Create a TODO heading.
|