]> git.notmuchmail.org Git - notmuch/blob - test/reply
test: Update tests with removal of bcc from reply
[notmuch] / test / reply
1 #!/bin/bash
2 test_description="\"notmuch reply\" in several variations"
3 . ./test-lib.sh
4
5 test_begin_subtest "Basic reply"
6 add_message '[from]="Sender <sender@example.com>"' \
7              [to]=test_suite@notmuchmail.org \
8              [subject]=notmuch-reply-test \
9             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
10             '[body]="basic reply test"'
11
12 output=$(notmuch reply id:${gen_msg_id})
13 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
14 Subject: Re: notmuch-reply-test
15 To: Sender <sender@example.com>
16 In-Reply-To: <${gen_msg_id}>
17 References: <${gen_msg_id}>
18
19 On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
20 > basic reply test"
21
22 test_begin_subtest "Multiple recipients"
23 add_message '[from]="Sender <sender@example.com>"' \
24             '[to]="test_suite@notmuchmail.org, Someone Else <someone@example.com>"' \
25              [subject]=notmuch-reply-test \
26             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
27             '[body]="Multiple recipients"'
28
29 output=$(notmuch reply id:${gen_msg_id})
30 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
31 Subject: Re: notmuch-reply-test
32 To: Sender <sender@example.com>, Someone Else <someone@example.com>
33 In-Reply-To: <${gen_msg_id}>
34 References: <${gen_msg_id}>
35
36 On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
37 > Multiple recipients"
38
39 test_begin_subtest "Reply with CC"
40 add_message '[from]="Sender <sender@example.com>"' \
41              [to]=test_suite@notmuchmail.org \
42             '[cc]="Other Parties <cc@example.com>"' \
43              [subject]=notmuch-reply-test \
44             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
45             '[body]="reply with CC"'
46
47 output=$(notmuch reply id:${gen_msg_id})
48 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
49 Subject: Re: notmuch-reply-test
50 To: Sender <sender@example.com>
51 Cc: Other Parties <cc@example.com>
52 In-Reply-To: <${gen_msg_id}>
53 References: <${gen_msg_id}>
54
55 On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
56 > reply with CC"
57
58 test_begin_subtest "Reply from alternate address"
59 add_message '[from]="Sender <sender@example.com>"' \
60              [to]=test_suite_other@notmuchmail.org \
61              [subject]=notmuch-reply-test \
62             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
63             '[body]="reply from alternate address"'
64
65 output=$(notmuch reply id:${gen_msg_id})
66 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
67 Subject: Re: notmuch-reply-test
68 To: Sender <sender@example.com>
69 In-Reply-To: <${gen_msg_id}>
70 References: <${gen_msg_id}>
71
72 On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
73 > reply from alternate address"
74
75 test_begin_subtest "Support for Reply-To"
76 add_message '[from]="Sender <sender@example.com>"' \
77              [to]=test_suite@notmuchmail.org \
78              [subject]=notmuch-reply-test \
79             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
80             '[body]="support for reply-to"' \
81             '[reply-to]="Sender <elsewhere@example.com>"'
82
83 output=$(notmuch reply id:${gen_msg_id})
84 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
85 Subject: Re: notmuch-reply-test
86 To: Sender <elsewhere@example.com>
87 In-Reply-To: <${gen_msg_id}>
88 References: <${gen_msg_id}>
89
90 On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
91 > support for reply-to"
92
93 test_begin_subtest "Un-munging Reply-To"
94 add_message '[from]="Sender <sender@example.com>"' \
95             '[to]="Some List <list@example.com>"' \
96              [subject]=notmuch-reply-test \
97             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
98             '[body]="Un-munging Reply-To"' \
99             '[reply-to]="Evil Munging List <list@example.com>"'
100
101 output=$(notmuch reply id:${gen_msg_id})
102 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
103 Subject: Re: notmuch-reply-test
104 To: Sender <sender@example.com>, Some List <list@example.com>
105 In-Reply-To: <${gen_msg_id}>
106 References: <${gen_msg_id}>
107
108 On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
109 > Un-munging Reply-To"
110
111 test_begin_subtest "Message with header of exactly 200 bytes"
112 add_message '[subject]="This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces"' \
113             '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
114             '[body]="200-byte header"'
115 output=$(notmuch reply id:${gen_msg_id})
116 test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
117 Subject: Re: This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces
118 In-Reply-To: <${gen_msg_id}>
119 References: <${gen_msg_id}>
120
121 On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:
122 > 200-byte header"
123 test_done