summaryrefslogtreecommitdiff
path: root/test-org-link-edit.el
diff options
context:
space:
mode:
Diffstat (limited to 'test-org-link-edit.el')
-rw-r--r--test-org-link-edit.el44
1 files changed, 44 insertions, 0 deletions
diff --git a/test-org-link-edit.el b/test-org-link-edit.el
index 4f006e7..7e4d2af 100644
--- a/test-org-link-edit.el
+++ b/test-org-link-edit.el
@@ -511,6 +511,50 @@ website"
(buffer-string)))))
+;;; Transport
+
+(ert-deftest test-org-link-edit/transport-next-link ()
+ "Test `org-link-edit-transport-next-link'."
+ (should
+ (string= "Here is \[\[http://orgmode.org/\]\[Org's\]\] website "
+ (org-test-with-temp-text
+ "Here is <point>Org's website http://orgmode.org/"
+ (org-link-edit-transport-next-link)
+ (buffer-string))))
+ (should
+ (string= " Here is \[\[http://orgmode.org/\]\[Org's\]\] website"
+ (org-test-with-temp-text
+ "http://orgmode.org/ Here is <point>Org's website"
+ (org-link-edit-transport-next-link 'previous)
+ (buffer-string))))
+ (should
+ (string= "\[\[http://orgmode.org/\]\[Here is Org's\]\] website "
+ (org-test-with-temp-text
+ "Here is Org's<point> website http://orgmode.org/"
+ (org-link-edit-transport-next-link
+ nil (point-min) (point))
+ (buffer-string))))
+ (should
+ (string= " Here is \[\[http://orgmode.org/\]\[Org's website\]\]"
+ (org-test-with-temp-text
+ "http://orgmode.org/ Here is <point>Org's website"
+ (org-link-edit-transport-next-link
+ 'previous (point) (point-max))
+ (buffer-string))))
+ (should-error
+ (org-test-with-temp-text
+ "Here is Org's website http://orgmode.org/<point>"
+ (org-link-edit-transport-next-link)
+ (buffer-string)))
+ (should-error
+ (org-test-with-temp-text
+ "Here is Org's website <point>http://orgmode.org/"
+ (org-link-edit-transport-next-link
+ nil (point-min) (point))
+ (buffer-string)))
+ )
+
+
;;; Other
(ert-deftest test-org-link-edit/on-link-p ()