2012-01-24 17:14:07 +01:00
|
|
|
(defun notmuch-test-address-cleaning-1 ()
|
|
|
|
(notmuch-test-expect-equal (notmuch-show-clean-address "dme@dme.org")
|
2020-08-08 13:49:38 +02:00
|
|
|
"dme@dme.org"))
|
2012-01-24 17:14:07 +01:00
|
|
|
|
|
|
|
(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>"
|
2012-01-25 14:54:00 +01:00
|
|
|
"Foo Bar"
|
2012-01-30 15:59:54 +01:00
|
|
|
"'Foo Bar' <foo@bar.com>"
|
|
|
|
"\"'Foo Bar'\" <foo@bar.com>"
|
|
|
|
"'\"Foo Bar\"' <foo@bar.com>"
|
|
|
|
"'\"'Foo Bar'\"' <foo@bar.com>"
|
2012-01-25 14:54:00 +01:00
|
|
|
"Fred Dibna \\[extraordinaire\\] <fred@dibna.com>"))
|
2012-01-24 17:14:07 +01:00
|
|
|
(expected '("ДБ <db-uknot@stop.me.uk>"
|
|
|
|
"foo (at home) <foo@bar.com>"
|
|
|
|
"foo [at home] <foo@bar.com>"
|
2012-01-25 14:54:00 +01:00
|
|
|
"Foo Bar"
|
2012-01-30 15:59:54 +01:00
|
|
|
"Foo Bar <foo@bar.com>"
|
|
|
|
"Foo Bar <foo@bar.com>"
|
|
|
|
"Foo Bar <foo@bar.com>"
|
|
|
|
"Foo Bar <foo@bar.com>"
|
2012-01-25 14:54:00 +01:00
|
|
|
"Fred Dibna [extraordinaire] <fred@dibna.com>"))
|
2012-01-24 17:14:07 +01:00
|
|
|
(output (mapcar #'notmuch-show-clean-address input)))
|
|
|
|
(notmuch-test-expect-equal output expected)))
|