summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Brand <michael.ch.brand@gmail.com>2013-09-12 22:48:16 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2013-09-12 22:57:07 +0200
commit8e07014036e4551fc3387562e6d0f3edbd9673e9 (patch)
treebead5039823e03bacf7b6000a7526ef026fc6a11
parentcbbb754cae5f05ab11988bd9fd5bfc4f949bc968 (diff)
downloadorg-mode-8e07014036e4551fc3387562e6d0f3edbd9673e9.tar.gz
Add ERTs for org-meta-return
* testing/lisp/test-org.el (test-org/meta-return): New `ert-deftest' to test `org-meta-return'.
-rw-r--r--testing/lisp/test-org.el45
1 files changed, 45 insertions, 0 deletions
diff --git a/testing/lisp/test-org.el b/testing/lisp/test-org.el
index 8a1e9f1..3538242 100644
--- a/testing/lisp/test-org.el
+++ b/testing/lisp/test-org.el
@@ -365,6 +365,51 @@
+;;; Editing
+
+;;;; Insert elements
+
+(ert-deftest test-org/meta-return ()
+ "Test M-RET (`org-meta-return')."
+ ;; In a table field insert a row above.
+ (should
+ (org-test-with-temp-text "| a |"
+ (forward-char)
+ (org-meta-return)
+ (forward-line -1)
+ (looking-at "| |$")))
+ ;; In a paragraph change current line into a header.
+ (should
+ (org-test-with-temp-text "a"
+ (org-meta-return)
+ (beginning-of-line)
+ (looking-at "\* a$")))
+ ;; In an item insert an item, in this case above.
+ (should
+ (org-test-with-temp-text "- a"
+ (org-meta-return)
+ (beginning-of-line)
+ (looking-at "- $")))
+ ;; In a drawer and paragraph insert an empty line, in this case above.
+ (should
+ (let ((org-drawers '("MYDRAWER")))
+ (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
+ (let ((org-drawers '("MYDRAWER")))
+ (org-test-with-temp-text ":MYDRAWER:\n- a\n:END:"
+ (forward-line)
+ (org-meta-return)
+ (beginning-of-line)
+ (looking-at "- $")))))
+
+
+
+
;;; Links
;;;; Fuzzy Links