aboutsummaryrefslogtreecommitdiff
path: root/tests/email.scm
diff options
context:
space:
mode:
authorArun Isaac2023-09-03 18:01:05 +0100
committerArun Isaac2023-09-03 18:01:05 +0100
commit900f720a7a0893f37f8c6b328f183e43086c1e52 (patch)
treebf01acd42a0533990ff19a38f0e8a132f3bdb1ca /tests/email.scm
parent0701c48d1eb43fb09b0f9a465a8d805df3ec161b (diff)
downloadguile-email-900f720a7a0893f37f8c6b328f183e43086c1e52.tar.gz
guile-email-900f720a7a0893f37f8c6b328f183e43086c1e52.tar.lz
guile-email-900f720a7a0893f37f8c6b328f183e43086c1e52.zip
email: Tolerate parentheses in display names.
* email/email.scm (define-atom-pattern): Support customization of the atext pattern as well. (define-phrase-pattern): New macro. (obs-phrase): Define using define-phrase-pattern. (liberal-atext, liberal-cfws-captured-atom, liberal-cfws-captured-word, liberal-phrase): New patterns. (display-name): Use liberal-phrase instead of phrase. * tests/email.scm ("tolerate email addresses with parentheses in name"): New test.
Diffstat (limited to 'tests/email.scm')
-rw-r--r--tests/email.scm4
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/email.scm b/tests/email.scm
index 50d1bea..dd305b6 100644
--- a/tests/email.scm
+++ b/tests/email.scm
@@ -590,6 +590,10 @@ Content-Type: text/plain; charset=utf-8
(parse-email-address "Foo P. Bar <foo@example.com>")
'((name . "Foo P. Bar") (address . "foo@example.com")))
+(test-equal "tolerate email addresses with parentheses in name"
+ (parse-email-address "Foo(Bar <foo@example.com>")
+ '((name . "Foo(Bar") (address . "foo@example.com")))
+
;;;
;;; MIME encoded words