Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
726a8e1
commit a317836
Showing
2 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(in-package :cl-mail.test) | ||
|
||
(plan 1) | ||
|
||
(subtest "Address parsing" | ||
|
||
(subtest "Malformed addresses" | ||
(is-error (cl-mail:mail-address.new "\"-Earnings...Notification-\" <vodacom.co.rs>") error)) | ||
|
||
(subtest "Just address" | ||
(let ((address (mail-address.new "test1@test.net"))) | ||
(is (mail-address-display-name address) nil) | ||
(is (mail-address-address address) "test1@test.net") | ||
(is (mail-address-host address) "test.net") | ||
(is (mail-address-user address) "test1") | ||
(is (mail-address-comments address) nil))) | ||
|
||
(subtest "Display name and address" | ||
(let ((address (mail-address.new "Test Test <test1@test.net>"))) | ||
(is (mail-address-display-name address) "Test Test") | ||
(is (mail-address-address address) "test1@test.net") | ||
(is (mail-address-host address) "test.net") | ||
(is (mail-address-user address) "test1") | ||
(is (mail-address-comments address) nil))) | ||
|
||
(subtest "Quoted display name and address" | ||
(let ((address (mail-address.new "\"Test @ Test <<>>>\" <test1@test.net>"))) | ||
(is (mail-address-display-name address) "Test @ Test <<>>>") | ||
(is (mail-address-address address) "test1@test.net") | ||
(is (mail-address-host address) "test.net") | ||
(is (mail-address-user address) "test1") | ||
(is (mail-address-comments address) nil)))) | ||
|
||
(finalize) |