From: shuhei Date: Sat, 28 Apr 2001 22:55:45 +0000 (+0000) Subject: Renamed all testcases. X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f421aecca621e692e7a654c26b1ad6ab0dfbe55a;p=elisp%2Fflim.git Renamed all testcases. --- diff --git a/tests/test-rfc2231.el b/tests/test-rfc2231.el index ab6c9c8..62a3b4b 100644 --- a/tests/test-rfc2231.el +++ b/tests/test-rfc2231.el @@ -3,9 +3,22 @@ (luna-define-class test-rfc2231 (lunit-test-case)) +;;; ;;; Parameter Value Continuations -;; The former is semantically identical to the latter. -(luna-define-method test-rfc2231-1 ((case test-rfc2231)) +;;; + +;; The content-type field +;; +;; Content-Type: message/external-body; access-type=URL; +;; URL*0="ftp://"; +;; URL*1="cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" +;; +;; is semantically identical to +;; +;; Content-Type: message/external-body; access-type=URL; +;; URL="ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar" +;; +(luna-define-method test-rfc2231-continuation-1 ((case test-rfc2231)) (lunit-assert (eq (mime-content-type-primary-type @@ -16,7 +29,7 @@ (mime-parse-Content-Type "message/external-body; access-type=URL; URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\""))))) -(luna-define-method test-rfc2231-2 ((case test-rfc2231)) +(luna-define-method test-rfc2231-continuation-2 ((case test-rfc2231)) (lunit-assert (eq (mime-content-type-subtype @@ -27,7 +40,7 @@ (mime-parse-Content-Type "message/external-body; access-type=URL; URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\""))))) -(luna-define-method test-rfc2231-3 ((case test-rfc2231)) +(luna-define-method test-rfc2231-continuation-3 ((case test-rfc2231)) (lunit-assert (string= (mime-content-type-parameter @@ -40,7 +53,7 @@ URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"") "access-type")))) -(luna-define-method test-rfc2231-4 ((case test-rfc2231)) +(luna-define-method test-rfc2231-continuation-4 ((case test-rfc2231)) (lunit-assert (string= (mime-content-type-parameter @@ -53,8 +66,13 @@ URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"") "url")))) +;;; ;;; Parameter Value Character Set and Language Information -(luna-define-method test-rfc2231-5 ((case test-rfc2231)) +;;; + +;; Content-Type: application/x-stuff; +;; title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A +(luna-define-method test-rfc2231-charset-language-1 ((case test-rfc2231)) (lunit-assert (string= (mime-content-type-parameter @@ -63,7 +81,24 @@ "title") "This is ***fun***"))) -(luna-define-method test-rfc2231-6 ((case test-rfc2231)) +(luna-define-method test-rfc2231-charset-language-2 ((case test-rfc2231)) + (lunit-assert + (string= + (mime-content-type-parameter + (mime-parse-Content-Type "application/x-stuff; + title*=''This%20is%20%2A%2A%2Afun%2A%2A%2A") + "title") + "This is ***fun***"))) + +;;; +;;; Combining Character Set, Language, and Parameter Continuations +;;; + +;; Content-Type: application/x-stuff; +;; title*0*=us-ascii'en'This%20is%20even%20more%20; +;; title*1*=%2A%2A%2Afun%2A%2A%2A%20; +;; title*2="isn't it!" +(luna-define-method test-rfc2231-charset-language-continuation-1 ((case test-rfc2231)) (lunit-assert (string= (mime-content-type-parameter @@ -74,8 +109,8 @@ "title") "This is even more ***fun*** isn't it!"))) -;;; MIME states that parameters are not order sensitive. -(luna-define-method test-rfc2231-7 ((case test-rfc2231)) +;; MIME states that parameters are not order sensitive. +(luna-define-method test-rfc2231-charset-language-continuation-2 ((case test-rfc2231)) (lunit-assert (string= (mime-content-type-parameter @@ -86,8 +121,8 @@ "title") "This is even more ***fun*** isn't it!"))) -;;; ABNF states that `ext-octet' is case-insensitive. -(luna-define-method test-rfc2231-8 ((case test-rfc2231)) +;; ABNF states that `ext-octet' is case-insensitive. +(luna-define-method test-rfc2231-charset-language-continuation-3 ((case test-rfc2231)) (lunit-assert (let ((case-fold-search nil)) (string= @@ -97,8 +132,8 @@ "title") "This is ***fun***")))) -;;; unencoded segments MUST NOT be decoded. -(luna-define-method test-rfc2231-9 ((case test-rfc2231)) +;; unencoded segments MUST NOT be decoded. +(luna-define-method test-rfc2231-charset-language-continuation-4 ((case test-rfc2231)) (lunit-assert (string= (mime-content-type-parameter @@ -109,31 +144,60 @@ "title") "This is even more ***fun*** isn%27t%20it!"))) -;;; both flim-1_13-rfc2231 and flim-1_14-rfc2231 choose to put language -;;; info to the `mime-language' text-property of the parameter value. -(luna-define-method test-rfc2231-10 ((case test-rfc2231)) +;;; +;;; Language specification in Encoded Words +;;; + +(luna-define-method test-rfc2231-encoded-word-1 ((case test-rfc2231)) + (lunit-assert + (string= + (eword-decode-encoded-word "=?US-ASCII?Q?Keith_Moore?=") + "Keith Moore"))) + +(luna-define-method test-rfc2231-encoded-word-2 ((case test-rfc2231)) (lunit-assert (string= + (eword-decode-encoded-word "=?US-ASCII*EN?Q?Keith_Moore?=") + "Keith Moore"))) + +(luna-define-method test-rfc2231-encoded-word-3 ((case test-rfc2231)) + (lunit-assert + (eq + (get-text-property + 0 'mime-language + (eword-decode-encoded-word "=?US-ASCII*EN?Q?Keith_Moore?=")) + 'en))) + +;;; +;;; Language specification in FLIM +;;; + +;; both flim-1_13-rfc2231 and flim-1_14-rfc2231 choose to put language +;; info to the `mime-language' text-property of the parameter value. + +(luna-define-method test-rfc2231-mime-language-1 ((case test-rfc2231)) + (lunit-assert + (eq (get-text-property 0 'mime-language (mime-content-type-parameter (mime-parse-Content-Type "application/x-stuff; title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A") "title")) - "en-us"))) + 'en-us))) -(luna-define-method test-rfc2231-11 ((case test-rfc2231)) +(luna-define-method test-rfc2231-mime-language-2 ((case test-rfc2231)) (lunit-assert - (string= + (eq (get-text-property 0 'mime-language (mime-content-type-parameter (mime-parse-Content-Type "application/x-stuff; title*=US-ASCII'EN-US'This%20is%20%2A%2A%2Afun%2A%2A%2A") "title")) - "en-us"))) + 'en-us))) -(luna-define-method test-rfc2231-12 ((case test-rfc2231)) +(luna-define-method test-rfc2231-mime-language-3 ((case test-rfc2231)) (lunit-assert (null (get-text-property @@ -142,3 +206,13 @@ (mime-parse-Content-Type "application/x-stuff; title*=us-ascii''This%20is%20%2A%2A%2Afun%2A%2A%2A") "title"))))) + +(luna-define-method test-rfc2231-mime-language-4 ((case test-rfc2231)) + (lunit-assert + (null + (get-text-property + 0 'mime-language + (mime-content-type-parameter + (mime-parse-Content-Type "application/x-stuff; + title*=''This%20is%20%2A%2A%2Afun%2A%2A%2A") + "title")))))