forked from mirrors/org-mode
org-element: Add tests
* testing/lisp/test-org-element.el: Add tests.
This commit is contained in:
parent
bc4351ce0d
commit
f1bb17549b
|
@ -1260,7 +1260,25 @@ e^{i\\pi}+1=0
|
||||||
;; 4. Angular link.
|
;; 4. Angular link.
|
||||||
(should
|
(should
|
||||||
(org-test-with-temp-text "A link: <http://orgmode.org>"
|
(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
|
;;;; Macro
|
||||||
|
|
Loading…
Reference in New Issue