mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2024-09-29 21:07:54 +00:00
test-org-element: Add tests for links
* testing/lisp/test-org-element.el (test-org-element/link-parser): add tests.
This commit is contained in:
parent
82cc4f43ec
commit
55e46fc260
|
@ -1428,6 +1428,25 @@ e^{i\\pi}+1=0
|
||||||
(lambda (l) (list (org-element-property :type l)
|
(lambda (l) (list (org-element-property :type l)
|
||||||
(org-element-property :path l)
|
(org-element-property :path l)
|
||||||
(org-element-property :application l)))))))
|
(org-element-property :application l)))))))
|
||||||
|
;; ... `:path' in a file-type link must be compatible with "file"
|
||||||
|
;; scheme in URI syntax, even if Org syntax isn't.
|
||||||
|
(should
|
||||||
|
(org-test-with-temp-text-in-file ""
|
||||||
|
(let ((file (expand-file-name (buffer-file-name))))
|
||||||
|
(insert (format "[[file://%s]]" file))
|
||||||
|
(equal (org-element-property :path (org-element-context))
|
||||||
|
(concat "//" file)))))
|
||||||
|
(should
|
||||||
|
(org-test-with-temp-text-in-file ""
|
||||||
|
(let ((file (expand-file-name (buffer-file-name))))
|
||||||
|
(insert (format "[[file:%s]]" file))
|
||||||
|
(equal (org-element-property :path (org-element-context))
|
||||||
|
(concat "//" file)))))
|
||||||
|
(should
|
||||||
|
(org-test-with-temp-text-in-file ""
|
||||||
|
(let ((file (file-relative-name (buffer-file-name))))
|
||||||
|
(insert (format "[[file:%s]]" file))
|
||||||
|
(list (org-element-property :path (org-element-context)) file))))
|
||||||
;; Plain link.
|
;; Plain link.
|
||||||
(should
|
(should
|
||||||
(org-test-with-temp-text "A link: http://orgmode.org"
|
(org-test-with-temp-text "A link: http://orgmode.org"
|
||||||
|
|
Loading…
Reference in a new issue