org-element: Add tests

* testing/lisp/test-org-element.el: Add tests.
This commit is contained in:
Nicolas Goaziou 2012-12-18 22:16:01 +01:00
parent bc4351ce0d
commit f1bb17549b
1 changed files with 19 additions and 1 deletions

View File

@ -1260,7 +1260,25 @@ e^{i\\pi}+1=0
;; 4. Angular link.
(should
(org-test-with-temp-text "A link: <http://orgmode.org>"
(org-element-map (org-element-parse-buffer) 'link 'identity nil t))))
(org-element-map (org-element-parse-buffer) 'link 'identity nil t)))
;; Link abbreviation.
(should
(equal "http"
(org-test-with-temp-text
"#+LINK: orgmode http://www.orgmode.org/\n[[orgmode:#docs]]"
(progn (org-mode-restart)
(goto-char (point-max))
(org-element-property :type (org-element-context))))))
;; Link abbreviation in a secondary string.
(should
(equal "http"
(org-test-with-temp-text
"#+LINK: orgmode http://www.orgmode.org/\n* H [[orgmode:#docs]]"
(progn (org-mode-restart)
(org-element-map
(org-element-parse-buffer) 'link
(lambda (link) (org-element-property :type link))
nil t nil t))))))
;;;; Macro