4 (luna-define-class test-rfc2231 (lunit-test-case))
7 ;;; Parameter Value Continuations
10 ;; The content-type field
12 ;; Content-Type: message/external-body; access-type=URL;
14 ;; URL*1="cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar"
16 ;; is semantically identical to
18 ;; Content-Type: message/external-body; access-type=URL;
19 ;; URL="ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar"
21 (luna-define-method test-rfc2231-continuation-1 ((case test-rfc2231))
24 (mime-content-type-primary-type
25 (mime-parse-Content-Type "message/external-body; access-type=URL;
27 URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\""))
28 (mime-content-type-primary-type
29 (mime-parse-Content-Type "message/external-body; access-type=URL;
30 URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"")))))
32 (luna-define-method test-rfc2231-continuation-2 ((case test-rfc2231))
35 (mime-content-type-subtype
36 (mime-parse-Content-Type "message/external-body; access-type=URL;
38 URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\""))
39 (mime-content-type-subtype
40 (mime-parse-Content-Type "message/external-body; access-type=URL;
41 URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"")))))
43 (luna-define-method test-rfc2231-continuation-3 ((case test-rfc2231))
46 (mime-content-type-parameter
47 (mime-parse-Content-Type "message/external-body; access-type=URL;
49 URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"")
51 (mime-content-type-parameter
52 (mime-parse-Content-Type "message/external-body; access-type=URL;
53 URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"")
56 (luna-define-method test-rfc2231-continuation-4 ((case test-rfc2231))
59 (mime-content-type-parameter
60 (mime-parse-Content-Type "message/external-body; access-type=URL;
62 URL*1=\"cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"")
64 (mime-content-type-parameter
65 (mime-parse-Content-Type "message/external-body; access-type=URL;
66 URL=\"ftp://cs.utk.edu/pub/moore/bulk-mailer/bulk-mailer.tar\"")
70 ;;; Parameter Value Character Set and Language Information
73 ;; Content-Type: application/x-stuff;
74 ;; title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A
75 (luna-define-method test-rfc2231-charset-language-1 ((case test-rfc2231))
78 (mime-content-type-parameter
79 (mime-parse-Content-Type "application/x-stuff;
80 title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A")
82 "This is ***fun***")))
84 (luna-define-method test-rfc2231-charset-language-2 ((case test-rfc2231))
87 (mime-content-type-parameter
88 (mime-parse-Content-Type "application/x-stuff;
89 title*=''This%20is%20%2A%2A%2Afun%2A%2A%2A")
91 "This is ***fun***")))
94 ;;; Combining Character Set, Language, and Parameter Continuations
97 ;; Content-Type: application/x-stuff;
98 ;; title*0*=us-ascii'en'This%20is%20even%20more%20;
99 ;; title*1*=%2A%2A%2Afun%2A%2A%2A%20;
100 ;; title*2="isn't it!"
101 (luna-define-method test-rfc2231-charset-language-continuation-1 ((case test-rfc2231))
104 (mime-content-type-parameter
105 (mime-parse-Content-Type "application/x-stuff;
106 title*0*=us-ascii'en'This%20is%20even%20more%20;
107 title*1*=%2A%2A%2Afun%2A%2A%2A%20;
108 title*2=\"isn't it!\"")
110 "This is even more ***fun*** isn't it!")))
112 ;; MIME states that parameters are not order sensitive.
113 (luna-define-method test-rfc2231-charset-language-continuation-2 ((case test-rfc2231))
116 (mime-content-type-parameter
117 (mime-parse-Content-Type "application/x-stuff;
118 title*2=\"isn't it!\";
119 title*1*=%2A%2A%2Afun%2A%2A%2A%20;
120 title*0*=us-ascii'en'This%20is%20even%20more%20")
122 "This is even more ***fun*** isn't it!")))
124 ;; ABNF states that `ext-octet' is case-insensitive.
125 (luna-define-method test-rfc2231-charset-language-continuation-3 ((case test-rfc2231))
127 (let ((case-fold-search nil))
129 (mime-content-type-parameter
130 (mime-parse-Content-Type "application/x-stuff;
131 title*=us-ascii'en-us'This%20is%20%2a%2a%2afun%2a%2a%2a")
133 "This is ***fun***"))))
135 ;; unencoded segments MUST NOT be decoded.
136 (luna-define-method test-rfc2231-charset-language-continuation-4 ((case test-rfc2231))
139 (mime-content-type-parameter
140 (mime-parse-Content-Type "application/x-stuff;
141 title*0*=us-ascii'en'This%20is%20even%20more%20;
142 title*1*=%2A%2A%2Afun%2A%2A%2A%20;
143 title*2=\"isn%27t%20it!\"")
145 "This is even more ***fun*** isn%27t%20it!")))
148 ;;; Language specification in Encoded Words
151 (luna-define-method test-rfc2231-encoded-word-1 ((case test-rfc2231))
154 (eword-decode-encoded-word "=?US-ASCII?Q?Keith_Moore?=")
157 (luna-define-method test-rfc2231-encoded-word-2 ((case test-rfc2231))
160 (eword-decode-encoded-word "=?US-ASCII*EN?Q?Keith_Moore?=")
163 (luna-define-method test-rfc2231-encoded-word-3 ((case test-rfc2231))
168 (eword-decode-encoded-word "=?US-ASCII*EN?Q?Keith_Moore?="))
172 ;;; Language specification in FLIM
175 ;; both flim-1_13-rfc2231 and flim-1_14-rfc2231 choose to put language
176 ;; info to the `mime-language' text-property of the parameter value.
178 (luna-define-method test-rfc2231-mime-language-1 ((case test-rfc2231))
183 (mime-content-type-parameter
184 (mime-parse-Content-Type "application/x-stuff;
185 title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A")
189 (luna-define-method test-rfc2231-mime-language-2 ((case test-rfc2231))
194 (mime-content-type-parameter
195 (mime-parse-Content-Type "application/x-stuff;
196 title*=US-ASCII'EN-US'This%20is%20%2A%2A%2Afun%2A%2A%2A")
200 (luna-define-method test-rfc2231-mime-language-3 ((case test-rfc2231))
205 (mime-content-type-parameter
206 (mime-parse-Content-Type "application/x-stuff;
207 title*=us-ascii''This%20is%20%2A%2A%2Afun%2A%2A%2A")
210 (luna-define-method test-rfc2231-mime-language-4 ((case test-rfc2231))
215 (mime-content-type-parameter
216 (mime-parse-Content-Type "application/x-stuff;
217 title*=''This%20is%20%2A%2A%2Afun%2A%2A%2A")