From 97c7e9c88a117bab1abe4da730e342c81624c4f4 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Tue, 31 Jul 2012 16:34:09 +0200 Subject: [PATCH] org-element: Add test --- testing/lisp/test-org-element.el | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/testing/lisp/test-org-element.el b/testing/lisp/test-org-element.el index 3ef2e637b..640f7d284 100644 --- a/testing/lisp/test-org-element.el +++ b/testing/lisp/test-org-element.el @@ -2491,10 +2491,13 @@ Outside." (ert-deftest test-org-element/down () "Test `org-element-down' specifications." - ;; 1. Error when the element hasn't got a recursive type. + ;; Error when the element hasn't got a recursive type. (org-test-with-temp-text "Paragraph." (should-error (org-element-down))) - ;; 2. When at a plain-list, move to first item. + ;; Error when the element has no contents + (org-test-with-temp-text "* Headline" + (should-error (org-element-down))) + ;; When at a plain-list, move to first item. (org-test-with-temp-text "- Item 1\n - Item 1.1\n - Item 2.2" (goto-line 2) (org-element-down) @@ -2502,11 +2505,11 @@ Outside." (org-test-with-temp-text "#+NAME: list\n- Item 1" (org-element-down) (should (looking-at " Item 1"))) - ;; 3. When at a table, move to first row + ;; When at a table, move to first row (org-test-with-temp-text "#+NAME: table\n| a | b |" (org-element-down) (should (looking-at " a | b |"))) - ;; 4. Otherwise, move inside the greater element. + ;; Otherwise, move inside the greater element. (org-test-with-temp-text "#+BEGIN_CENTER\nParagraph.\n#+END_CENTER" (org-element-down) (should (looking-at "Paragraph"))))