From: kaoru Date: Sat, 21 Feb 2004 20:29:15 +0000 (+0000) Subject: * test-rfc2368.el: New file. X-Git-Tag: wl-2_11_25~45 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=aae257e9533ae8b3d2cf25cdab7f51a3f7846fa9;p=elisp%2Fwanderlust.git * test-rfc2368.el: New file. --- diff --git a/tests/ChangeLog b/tests/ChangeLog index a1ac941..c66b412 100644 --- a/tests/ChangeLog +++ b/tests/ChangeLog @@ -1,5 +1,7 @@ 2004-02-21 TAKAHASHI Kaoru + * test-rfc2368.el: New file. + * test-elmo-util.el (test-elmo-number-set-member-1): Use `equal'. (test-elmo-number-set-member-2): New testcase. diff --git a/tests/test-rfc2368.el b/tests/test-rfc2368.el new file mode 100644 index 0000000..763ced2 --- /dev/null +++ b/tests/test-rfc2368.el @@ -0,0 +1,50 @@ +(require 'lunit) +(require 'rfc2368) + +(luna-define-class test-rfc2368 (lunit-test-case)) + +(luna-define-method test-rfc2368-parse-mailto-url-1 ((case test-rfc2368)) + "To field only." + (lunit-assert + (equal + '(("To" . "chris@example.com")) + (rfc2368-parse-mailto-url "mailto:chris@example.com")))) + +(luna-define-method test-rfc2368-parse-mailto-url-2 ((case test-rfc2368)) + "RFC2368 example in 2. Syntax of a mailto URL " + (lunit-assert + (equal + (rfc2368-parse-mailto-url "mailto:addr1%2C%20addr2") + (rfc2368-parse-mailto-url "mailto:?to=addr1%2C%20addr2"))) + (lunit-assert + (equal + (rfc2368-parse-mailto-url "mailto:?to=addr1%2C%20addr2") + (rfc2368-parse-mailto-url "mailto:addr1?to=addr2")))) + +(luna-define-method test-rfc2368-parse-mailto-url-3 ((case test-rfc2368)) + "With Subject field." + (lunit-assert + (equal + '(("To" . "infobot@example.com") + ("Subject" . "current-issue")) + (rfc2368-parse-mailto-url + "mailto:infobot@example.com?subject=current-issue")))) + +(luna-define-method test-rfc2368-parse-mailto-url-4 ((case test-rfc2368)) + "Space in Subject field." + (lunit-assert + (equal + '(("To" . "infobot@example.com") + ("Body" . "send current-issue")) + (rfc2368-parse-mailto-url + "mailto:infobot@example.com?body=send%20current-issue")))) + +(luna-define-method test-rfc2368-parse-mailto-url-5 ((case test-rfc2368)) + "CRLF in body." + (lunit-assert + (equal + '(("To" . "infobot@example.com") + ("Body" . "send current-issue\nsend index")) + (rfc2368-parse-mailto-url + (concat "mailto:infobot@example.com?body=send%20current-\n" + "issue%0D%0Asend%20index")))))