From: shuhei Date: Sun, 22 Apr 2001 02:27:10 +0000 (+0000) Subject: Made independent of internal representation of Content-Type. X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=5b623e743f711e7e114e47b7f3112e95a771c676;p=elisp%2Fflim.git Made independent of internal representation of Content-Type. --- diff --git a/tests/test-rfc2231.el b/tests/test-rfc2231.el index 2089b6f..1091025 100644 --- a/tests/test-rfc2231.el +++ b/tests/test-rfc2231.el @@ -3,46 +3,73 @@ (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)) (lunit-assert - (equal - (mime-parse-Content-Type "\ - message/external-body; access-type=URL; + (eq + (mime-content-type-primary-type + (mime-parse-Content-Type "message/external-body; access-type=URL; URL*0=\"ftp://\"; - URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"") - (mime-parse-Content-Type "\ - message/external-body; access-type=URL; - URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"")))) + URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"")) + (mime-content-type-primary-type + (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)) (lunit-assert - (equal - (mime-parse-Content-Type "\ - application/x-stuff; - title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A") - '((type . application) (subtype . x-stuff) - ("title" . #("This is ***fun***" 0 17 (mime-language "en-us"))))))) + (eq + (mime-content-type-subtype + (mime-parse-Content-Type "message/external-body; access-type=URL; + URL*0=\"ftp://\"; + URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"")) + (mime-content-type-subtype + (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)) (lunit-assert - (equal - (mime-parse-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!\"") - '((type . application) (subtype . x-stuff) - ("title" . #("This is even more ***fun*** isn't it!" 0 37 (mime-language "en"))))))) + (string= + (mime-content-type-parameter + (mime-parse-Content-Type "message/external-body; access-type=URL; + URL*0=\"ftp://\"; + URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"") + "access-type") + (mime-content-type-parameter + (mime-parse-Content-Type "message/external-body; access-type=URL; + URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"") + "access-type")))) (luna-define-method test-rfc2231-4 ((case test-rfc2231)) (lunit-assert - (equal - (mime-parse-Content-Type "\ - application/x-stuff; + (string= + (mime-content-type-parameter + (mime-parse-Content-Type "message/external-body; access-type=URL; + URL*0=\"ftp://\"; + URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"") + "url") + (mime-content-type-parameter + (mime-parse-Content-Type "message/external-body; access-type=URL; + 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)) + (lunit-assert + (string= + (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") + "This is ***fun***"))) + +(luna-define-method test-rfc2231-6 ((case test-rfc2231)) + (lunit-assert + (string= + (mime-content-type-parameter + (mime-parse-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!\"") - (mime-parse-Content-Type "\ - application/x-stuff; - title*=us-ascii'en'This%20is%20even%20more%20%2A%2A%2Afun%2A%2A%2A%20isn%27t%20it!\"")))) + "title") + "This is even more ***fun*** isn't it!")))