New file.
authorshuhei <shuhei>
Sun, 22 Apr 2001 00:57:05 +0000 (00:57 +0000)
committershuhei <shuhei>
Sun, 22 Apr 2001 00:57:05 +0000 (00:57 +0000)
tests/test-rfc2231.el [new file with mode: 0644]

diff --git a/tests/test-rfc2231.el b/tests/test-rfc2231.el
new file mode 100644 (file)
index 0000000..2089b6f
--- /dev/null
@@ -0,0 +1,48 @@
+(require 'lunit)
+(require 'mime)
+
+(luna-define-class test-rfc2231 (lunit-test-case))
+
+;; 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;
+ 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\""))))
+
+(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")))))))
+
+(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")))))))
+
+(luna-define-method test-rfc2231-4 ((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!\"")
+    (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!\""))))