summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Téchoueyres <pierre.techoueyres@free.fr>2019-03-10 17:57:26 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2019-03-10 18:20:58 +0100
commit2216f4d2c71b31b11bb13ec13b312fe77b9de21a (patch)
tree5e89e9babacba1642b3499cc9bde244ec2d6abb7
parent5ac6ca24fac31e0953a54365b2adbec8fc90626d (diff)
downloadorg-mode-2216f4d2c71b31b11bb13ec13b312fe77b9de21a.tar.gz
org-protocol: Fix URL handling -- add tests
* testing/lisp/test-org-protocol.el (test-org-protocol/org-protocol-parse-parameters): Add test for the commit e0bfdec22 which un-escape extracted link as it is url-encoded externally.
-rw-r--r--testing/lisp/test-org-protocol.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/testing/lisp/test-org-protocol.el b/testing/lisp/test-org-protocol.el
index fc76438..6ee368d 100644
--- a/testing/lisp/test-org-protocol.el
+++ b/testing/lisp/test-org-protocol.el
@@ -35,6 +35,16 @@
(let ((data (org-protocol-parse-parameters "url=abc&title=def" t)))
(should (string= (plist-get data :url) "abc"))
(should (string= (plist-get data :title) "def")))
+ ;; Parse new-style complex links
+ (let* ((url (concat "template=p&"
+ "url=https%3A%2F%2Forgmode.org%2Forg.html%23capture-protocol&"
+ "title=The%20Org%20Manual&"
+ "body=9.4.2%20capture%20protocol"))
+ (data (org-protocol-parse-parameters url)))
+ (should (string= (plist-get data :template) "p"))
+ (should (string= (plist-get data :url) "https://orgmode.org/org.html#capture-protocol"))
+ (should (string= (plist-get data :title) "The Org Manual"))
+ (should (string= (plist-get data :body) "9.4.2 capture protocol")))
;; Parse old-style links
(let ((data (org-protocol-parse-parameters "abc/def" nil '(:url :title))))
(should (string= (plist-get data :url) "abc"))