1 ;; -*- lexical-binding: t -*-
5 (luna-define-class test-wl-draft (lunit-test-case))
7 (luna-define-method test-wl-draft-deduce-address-list-1 ((case test-wl-draft))
10 '("foo@example.com" "bar@example.com")
12 (insert "To: foo@example.com, bar@example.com
14 (wl-draft-deduce-address-list (current-buffer) (point-min) (point-max))))))
16 (luna-define-method test-wl-draft-deduce-address-list-2 ((case test-wl-draft))
19 '("foo@example.com" "bar@example.com")
21 (insert "To: foo@example.com
24 (wl-draft-deduce-address-list (current-buffer) (point-min) (point-max))))))
26 ;; RFC 2822 A.1.2. Different types of mailboxes
27 (luna-define-method test-wl-draft-deduce-address-list-rfc2822-example-1 ((case test-wl-draft))
30 '("mary@x.test" "jdoe@example.org" "one@y.test" "boss@nil.test" "sysservices@example.net")
32 (insert "From: \"Joe Q. Public\" <john.q.public@example.com>
33 To: Mary Smith <mary@x.test>, jdoe@example.org, Who? <one@y.test>
34 Cc: <boss@nil.test>, \"Giant; \\\"Big\\\" Box\" <sysservices@example.net>
35 Date: Tue, 1 Jul 2003 10:52:37 +0200
36 Message-ID: <5678.21-Nov-1997@example.com>
38 (wl-draft-deduce-address-list (current-buffer) (point-min) (point-max))))))
40 ;; RFC 2822 A.1.3. Group addresses
41 (luna-define-method test-wl-draft-deduce-address-list-rfc2822-example-2 ((case test-wl-draft))
44 '("c@a.test" "joe@where.test" "jdoe@one.test")
46 (insert "From: Pete <pete@silly.example>
47 To: A Group:Chris Jones <c@a.test>,joe@where.test,John <jdoe@one.test>;
48 Cc: Undisclosed recipients:;
49 Date: Thu, 13 Feb 1969 23:32:54 -0330
50 Message-ID: <testabcd.1234@silly.example>
52 (wl-draft-deduce-address-list (current-buffer) (point-min) (point-max))))))
54 ;; RFC 2822 A.3. Resent messages
55 (luna-define-method test-wl-draft-deduce-address-list-rfc2822-example-3 ((case test-wl-draft))
58 '("j-brown@other.example")
60 (insert "Resent-From: Mary Smith <mary@example.net>
61 Resent-To: Jane Brown <j-brown@other.example>
62 Resent-Date: Mon, 24 Nov 1997 14:22:01 -0800
63 Resent-Message-ID: <78910@example.net>
64 From: John Doe <jdoe@machine.example>
65 To: Mary Smith <mary@example.net>
67 Date: Fri, 21 Nov 1997 09:55:06 -0600
68 Message-ID: <1234@local.machine.example>
70 (wl-draft-deduce-address-list (current-buffer) (point-min) (point-max))))))
73 (luna-define-method test-wl-draft-deduce-address-list-rfc2822-obs-1 ((case test-wl-draft))
78 (insert "To: foo.bar <foo@example.com>
80 (wl-draft-deduce-address-list (current-buffer) (point-min) (point-max))))))
82 ;; multiple occurrences of destination address fields
83 (luna-define-method test-wl-draft-deduce-address-list-rfc2822-obs-2 ((case test-wl-draft))
86 '("foo@example.com" "bar@example.com")
88 (insert "To: foo@example.com
91 (wl-draft-deduce-address-list (current-buffer) (point-min) (point-max))))))