Hi Carsten

On Thu, Sep 12, 2013 at 10:20 PM, Carsten Dominik
<carsten.domi...@gmail.com> wrote:
> thanks for the patch - I think we will go with Nicolas' patch for fixing 
> org-insert-heading.  May I ask you to check if your tests still to the right 
> thing, and resubmit the test patch?
>
> Many thanks in advance.

Yes, merged patch attached. No changes in the test cases were necessary.

Michael
From d87dd6c70c594b55abcabdb67ea6852b261a1a7c Mon Sep 17 00:00:00 2001
From: Michael Brand <michael.ch.br...@gmail.com>
Date: Thu, 12 Sep 2013 22:48:16 +0200
Subject: [PATCH] Add ERTs for org-meta-return

* testing/lisp/test-org.el (test-org/meta-return): New `ert-deftest'
to test `org-meta-return'.
---
 testing/lisp/test-org.el | 45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

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
-- 
1.7.12.4 (Apple Git-37)

Reply via email to