unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
blob 6eda0ebc913f9b3cd88193a5cc12dc65b8b18c33 1350 bytes (raw)
name: test/emacs-address-cleaning.el 	 # note: path name is non-authoritative(*)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
(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)))

debug log:

solving 6eda0ebc ...
found 6eda0ebc in https://yhetil.org/notmuch.git/

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).