]> git.notmuchmail.org Git - notmuch/blob - test/t0005-reply.sh
test: Fix test suite to integrate with our non-recursive Makefile system.
[notmuch] / test / t0005-reply.sh
1 #!/bin/bash
2 test_description="\"notmuch reply\" in several variations"
3 . ./test-lib.sh
4
5 test_expect_success "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 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
14 Subject: Re: notmuch-reply-test
15 To: Sender <sender@example.com>
16 Bcc: test_suite@notmuchmail.org
17 In-Reply-To: <${gen_msg_id}>
18 References: <${gen_msg_id}>
19
20 On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
21 > basic reply test"
22
23 '
24 test_expect_success "Multiple recipients" '
25 add_message "[from]=\"Sender <sender@example.com>\"" \
26             "[to]=\"test_suite@notmuchmail.org, Someone Else <someone@example.com>\"" \
27              [subject]=notmuch-reply-test \
28             "[date]=\"Tue, 05 Jan 2010 15:43:56 -0000\"" \
29             "[body]=\"Multiple recipients\"" &&
30
31 output=$($NOTMUCH reply id:${gen_msg_id}) &&
32 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
33 Subject: Re: notmuch-reply-test
34 To: Sender <sender@example.com>, Someone Else <someone@example.com>
35 Bcc: test_suite@notmuchmail.org
36 In-Reply-To: <${gen_msg_id}>
37 References: <${gen_msg_id}>
38
39 On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
40 > Multiple recipients"
41
42 '
43 test_expect_success "Reply with CC" '
44 add_message "[from]=\"Sender <sender@example.com>\"" \
45              [to]=test_suite@notmuchmail.org \
46             "[cc]=\"Other Parties <cc@example.com>\"" \
47              [subject]=notmuch-reply-test \
48             "[date]=\"Tue, 05 Jan 2010 15:43:56 -0000\"" \
49             "[body]=\"reply with CC\"" &&
50
51 output=$($NOTMUCH reply id:${gen_msg_id}) &&
52 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
53 Subject: Re: notmuch-reply-test
54 To: Sender <sender@example.com>
55 Cc: Other Parties <cc@example.com>
56 Bcc: test_suite@notmuchmail.org
57 In-Reply-To: <${gen_msg_id}>
58 References: <${gen_msg_id}>
59
60 On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
61 > reply with CC"
62
63 '
64 test_expect_success "Reply from alternate address" '
65 add_message "[from]=\"Sender <sender@example.com>\"" \
66              [to]=test_suite_other@notmuchmail.org \
67              [subject]=notmuch-reply-test \
68             "[date]=\"Tue, 05 Jan 2010 15:43:56 -0000\"" \
69             "[body]=\"reply from alternate address\"" &&
70
71 output=$($NOTMUCH reply id:${gen_msg_id}) &&
72 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
73 Subject: Re: notmuch-reply-test
74 To: Sender <sender@example.com>
75 Bcc: test_suite@notmuchmail.org
76 In-Reply-To: <${gen_msg_id}>
77 References: <${gen_msg_id}>
78
79 On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
80 > reply from alternate address"
81
82 '
83 test_expect_success "Support for Reply-To" '
84 add_message "[from]=\"Sender <sender@example.com>\"" \
85              [to]=test_suite@notmuchmail.org \
86              [subject]=notmuch-reply-test \
87             "[date]=\"Tue, 05 Jan 2010 15:43:56 -0000\"" \
88             "[body]=\"support for reply-to\"" \
89             "[reply-to]=\"Sender <elsewhere@example.com>\"" &&
90
91 output=$($NOTMUCH reply id:${gen_msg_id}) &&
92 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
93 Subject: Re: notmuch-reply-test
94 To: Sender <elsewhere@example.com>
95 Bcc: test_suite@notmuchmail.org
96 In-Reply-To: <${gen_msg_id}>
97 References: <${gen_msg_id}>
98
99 On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
100 > support for reply-to"
101
102 '
103 test_expect_success "Un-munging Reply-To" '
104 add_message "[from]=\"Sender <sender@example.com>\"" \
105             "[to]=\"Some List <list@example.com>\"" \
106              [subject]=notmuch-reply-test \
107             "[date]=\"Tue, 05 Jan 2010 15:43:56 -0000\"" \
108             "[body]=\"Un-munging Reply-To\"" \
109             "[reply-to]=\"Evil Munging List <list@example.com>\"" &&
110
111 output=$($NOTMUCH reply id:${gen_msg_id}) &&
112 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
113 Subject: Re: notmuch-reply-test
114 To: Sender <sender@example.com>, Some List <list@example.com>
115 Bcc: test_suite@notmuchmail.org
116 In-Reply-To: <${gen_msg_id}>
117 References: <${gen_msg_id}>
118
119 On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
120 > Un-munging Reply-To"
121 '
122
123 test_expect_success "Message with header of exactly 200 bytes" '
124 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\"" \
125             "[date]=\"Tue, 05 Jan 2010 15:43:56 -0000\"" \
126             "[body]=\"200-byte header\"" &&
127 output=$($NOTMUCH reply id:${gen_msg_id}) &&
128 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
129 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
130 Bcc: test_suite@notmuchmail.org
131 In-Reply-To: <${gen_msg_id}>
132 References: <${gen_msg_id}>
133
134 On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:
135 > 200-byte header"
136 '
137 test_done