aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/email.scm53
1 files changed, 53 insertions, 0 deletions
diff --git a/tests/email.scm b/tests/email.scm
index 177391e..d0eed13 100644
--- a/tests/email.scm
+++ b/tests/email.scm
@@ -102,6 +102,59 @@ Content-Length: 4349
(x-mailer . "FooMail 4.0 4.03 (SMT460B92F)")
(content-length . "4349")))
+(test-equal "RFC2046 5.1.1. Common syntax"
+ (parse-email
+ (string->bytevector
+ "From: Nathaniel Borenstein <nsb@bellcore.com>
+To: Ned Freed <ned@innosoft.com>
+Date: Sun, 21 Mar 1993 23:56:48 -0800 (PST)
+Subject: Sample message
+MIME-Version: 1.0
+Content-type: multipart/mixed; boundary=\"simple boundary\"
+
+This is the preamble. It is to be ignored, though it
+is a handy place for composition agents to include an
+explanatory note to non-MIME conformant readers.
+
+--simple boundary
+
+This is implicitly typed plain US-ASCII text.
+It does NOT end with a linebreak.
+--simple boundary
+Content-type: text/plain; charset=us-ascii
+
+This is explicitly typed plain US-ASCII text.
+It DOES end with a linebreak.
+
+--simple boundary--
+
+This is the epilogue. It is also to be ignored.
+" "utf-8"))
+ (make-email
+ `((content-transfer-encoding . 7bit)
+ (from ((name . "Nathaniel Borenstein")
+ (address . "nsb@bellcore.com")))
+ (to ((name . "Ned Freed")
+ (address . "ned@innosoft.com")))
+ (date . ,(make-date 0 48 56 23 21 3 1993 -28800))
+ (subject . "Sample message")
+ (mime-version . "1.0")
+ (content-type (type . multipart)
+ (subtype . mixed)
+ (boundary . "simple boundary")))
+ (list (make-mime-entity '((content-type (type . text)
+ (subtype . plain)
+ (charset . "utf-8"))
+ (content-transfer-encoding . 7bit))
+ "This is implicitly typed plain US-ASCII text.
+It does NOT end with a linebreak.")
+ (make-mime-entity '((content-transfer-encoding . 7bit)
+ (content-type (type . text)
+ (subtype . plain)
+ (charset . "us-ascii")))
+ "This is explicitly typed plain US-ASCII text.
+It DOES end with a linebreak."))))
+
(test-equal "decode MIME entity without headers"
((module-ref (resolve-module '(email email))
'parse-mime-entity)