mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-12-28 20:31:43 +01:00
32d7b3aabd
Remove outer single-quotes from the mailbox part. Allow for multiple sets of nested single and double quotes. Add more tests.
39 lines
1.3 KiB
EmacsLisp
39 lines
1.3 KiB
EmacsLisp
(defun notmuch-test-address-cleaning-1 ()
|
|
(notmuch-test-expect-equal (notmuch-show-clean-address "dme@dme.org")
|
|
"dme@dme.org"))
|
|
|
|
(defun notmuch-test-address-cleaning-2 ()
|
|
(let* ((input '("foo@bar.com"
|
|
"<foo@bar.com>"
|
|
"Foo Bar <foo@bar.com>"
|
|
"foo@bar.com <foo@bar.com>"
|
|
"\"Foo Bar\" <foo@bar.com>"))
|
|
(expected '("foo@bar.com"
|
|
"foo@bar.com"
|
|
"Foo Bar <foo@bar.com>"
|
|
"foo@bar.com"
|
|
"Foo Bar <foo@bar.com>"))
|
|
(output (mapcar #'notmuch-show-clean-address input)))
|
|
(notmuch-test-expect-equal output expected)))
|
|
|
|
(defun notmuch-test-address-cleaning-3 ()
|
|
(let* ((input '("ДБ <db-uknot@stop.me.uk>"
|
|
"foo (at home) <foo@bar.com>"
|
|
"foo [at home] <foo@bar.com>"
|
|
"Foo Bar"
|
|
"'Foo Bar' <foo@bar.com>"
|
|
"\"'Foo Bar'\" <foo@bar.com>"
|
|
"'\"Foo Bar\"' <foo@bar.com>"
|
|
"'\"'Foo Bar'\"' <foo@bar.com>"
|
|
"Fred Dibna \\[extraordinaire\\] <fred@dibna.com>"))
|
|
(expected '("ДБ <db-uknot@stop.me.uk>"
|
|
"foo (at home) <foo@bar.com>"
|
|
"foo [at home] <foo@bar.com>"
|
|
"Foo Bar"
|
|
"Foo Bar <foo@bar.com>"
|
|
"Foo Bar <foo@bar.com>"
|
|
"Foo Bar <foo@bar.com>"
|
|
"Foo Bar <foo@bar.com>"
|
|
"Fred Dibna [extraordinaire] <fred@dibna.com>"))
|
|
(output (mapcar #'notmuch-show-clean-address input)))
|
|
(notmuch-test-expect-equal output expected)))
|