aboutsummaryrefslogtreecommitdiff
path: root/tests/email.scm
diff options
context:
space:
mode:
authorArun Isaac2020-12-05 14:16:21 +0530
committerArun Isaac2020-12-05 14:16:21 +0530
commite65b6bacc2adc0c72711ed3b39e533cb6186f3b1 (patch)
tree49050d8b2c7e4f41440b82e96c73b78ec8d8c670 /tests/email.scm
parent37e245539bc9e27db35731e7b517cdde397834e2 (diff)
downloadguile-email-e65b6bacc2adc0c72711ed3b39e533cb6186f3b1.tar.gz
guile-email-e65b6bacc2adc0c72711ed3b39e533cb6186f3b1.tar.lz
guile-email-e65b6bacc2adc0c72711ed3b39e533cb6186f3b1.zip
email: Support obsolete date and time.
* email/email.scm (obs-day-of-week, obs-day, obs-year, obs-hour, obs-minute, obs-second, obs-zone): New macros. (day-of-week, day, year, hours, minutes, seconds, zone): Include obsolete pattern. (parse-email-headers): Handle obsolete two and three digit years, and alphabetic time zone specifiers. * tests/email.scm ("RFC5322 A.6.2. Obsolete dates"): New test.
Diffstat (limited to 'tests/email.scm')
-rw-r--r--tests/email.scm28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/email.scm b/tests/email.scm
index 8a7be9b..d3801a9 100644
--- a/tests/email.scm
+++ b/tests/email.scm
@@ -215,6 +215,34 @@ Hi everyone.
(content-transfer-encoding . 7bit))
"Hi everyone."))
+(test-email= "RFC5322 A.6.2. Obsolete dates"
+ (parse-email
+ (string->bytevector
+ "From: John Doe <jdoe@machine.example>
+To: Mary Smith <mary@example.net>
+Subject: Saying Hello
+Date: 21 Nov 97 09:55:06 GMT
+Message-ID: <1234@local.machine.example>
+
+This is a message just to say hello.
+So, \"Hello\".
+"
+ "utf-8"))
+ (make-email
+ `((from ((name . "John Doe")
+ (address . "jdoe@machine.example")))
+ (to ((name . "Mary Smith")
+ (address . "mary@example.net")))
+ (subject . "Saying Hello")
+ (date . ,(make-date 0 6 55 9 21 11 1997 0))
+ (message-id . "1234@local.machine.example")
+ (content-type (type . text)
+ (subtype . plain)
+ (charset . "utf-8"))
+ (content-transfer-encoding . 7bit))
+ "This is a message just to say hello.
+So, \"Hello\"."))
+
(test-email= "RFC2046 5.1.1. Common syntax"
(parse-email
(string->bytevector