3 ;; Copyright (c) ߚ David Maus
6 ;; Released under the GNU General Public License version 3
7 ;; see: http://www.gnu.org/licenses/gpl-3.0.html
11 ;; Template test file for Org-mode tests
15 (let* ((testing-lisp-dir (file-name-directory
16 (or load-file-name buffer-file-name
)))
17 (load-path (cons testing-lisp-dir load-path
)))
18 (dolist (file (directory-files testing-lisp-dir
'full
19 "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*\\.org$"))
20 (require (intern (substring file
0 (- (length file
) 3))))))
24 (ert-deftest test-org
/org-link-escape-ascii-character
()
25 "Escape an ascii character."
29 (org-link-escape "["))))
31 (ert-deftest test-org
/org-link-escape-ascii-ctrl-character
()
32 "Escape an ascii control character."
36 (org-link-escape "\t"))))
38 (ert-deftest test-org
/org-link-escape-multibyte-character
()
39 "Escape an unicode multibyte character."
43 (org-link-escape "€"))))
45 (ert-deftest test-org
/org-link-escape-custom-table
()
46 "Escape string with custom character table."
50 (org-link-escape "Foo:Bar\n" '(?\
: ?\B
)))))
52 (ert-deftest test-org
/org-link-escape-custom-table-merge
()
53 "Escape string with custom table merged with default table."
56 "%5BF%6F%6F%3A%42ar%0A%5D"
57 (org-link-escape "[Foo:Bar\n]" '(?\
: ?\B ?\o
) t
))))
59 (ert-deftest test-org
/org-link-unescape-ascii-character
()
60 "Unescape an ascii character."
64 (org-link-unescape "%5B"))))
66 (ert-deftest test-org
/org-link-unescape-ascii-ctrl-character
()
67 "Unescpae an ascii control character."
71 (org-link-unescape "%0A"))))
73 (ert-deftest test-org
/org-link-unescape-multibyte-character
()
74 "Unescape unicode multibyte character."
78 (org-link-unescape "%E2%82%AC"))))
80 (ert-deftest test-org
/org-link-unescape-ascii-extended-char
()
81 "Unescape old style percent escaped character."
85 (decode-coding-string (org-link-unescape "%E0%E2%E7%E8%E9%EA%EE%F4%F9%FB") 'latin-1
))))
87 (ert-deftest test-org
/org-link-escape-url-with-escaped-char
()
88 "Escape and unscape a URL that includes an escaped char.
89 http://article.gmane.org/gmane.emacs.orgmode/21459/"
92 "http://some.host.com/form?&id=blah%2Bblah25"
93 (org-link-unescape (org-link-escape "http://some.host.com/form?&id=blah%2Bblah25")))))
97 ;;; test-org.el ends here