2 test_description="naming of threads with changing subject"
5 test_begin_subtest 'Generate some messages'
6 add_message '[subject]="thread-naming: Initial thread subject"' \
7 '[date]="Fri, 05 Jan 2001 15:43:56 -0000"'
10 add_message '[subject]="thread-naming: Older changed subject"' \
11 '[date]="Sat, 06 Jan 2001 15:43:56 -0000"' \
12 "[in-reply-to]=\<$parent\>"
13 add_message '[subject]="thread-naming: Newer changed subject"' \
14 '[date]="Sun, 07 Jan 2001 15:43:56 -0000"' \
15 "[in-reply-to]=\<$parent\>"
16 add_message '[subject]="thread-naming: Final thread subject"' \
17 '[date]="Mon, 08 Jan 2001 15:43:56 -0000"' \
18 "[in-reply-to]=\<$parent\>"
21 test_begin_subtest "Initial thread name (oldest-first search)"
22 output=$(notmuch search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize)
23 test_expect_equal "$output" "thread:XXX 2001-01-05 [4/4] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
25 test_begin_subtest "Initial thread name (newest-first search)"
26 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
27 test_expect_equal "$output" "thread:XXX 2001-01-08 [4/4] Notmuch Test Suite; thread-naming: Final thread subject (inbox unread)"
29 # Remove oldest and newest messages from search results
30 notmuch tag -inbox id:$parent or id:$final
32 test_begin_subtest "Changed thread name (oldest-first search)"
33 output=$(notmuch search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize)
34 test_expect_equal "$output" "thread:XXX 2001-01-06 [2/4] Notmuch Test Suite; thread-naming: Older changed subject (inbox unread)"
36 test_begin_subtest "Changed thread name (newest-first search)"
37 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
38 test_expect_equal "$output" "thread:XXX 2001-01-07 [2/4] Notmuch Test Suite; thread-naming: Newer changed subject (inbox unread)"
40 test_begin_subtest "Ignore added reply prefix (Re:)"
41 add_message '[subject]="Re: thread-naming: Initial thread subject"' \
42 '[date]="Tue, 09 Jan 2001 15:43:45 -0000"' \
43 "[in-reply-to]=\<$parent\>"
44 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
45 test_expect_equal "$output" "thread:XXX 2001-01-09 [3/5] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
47 test_begin_subtest "Ignore added reply prefix (Aw:)"
48 add_message '[subject]="Aw: thread-naming: Initial thread subject"' \
49 '[date]="Wed, 10 Jan 2001 15:43:45 -0000"' \
50 "[in-reply-to]=\<$parent\>"
51 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
52 test_expect_equal "$output" "thread:XXX 2001-01-10 [4/6] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
54 test_begin_subtest "Ignore added reply prefix (Vs:)"
55 add_message '[subject]="Vs: thread-naming: Initial thread subject"' \
56 '[date]="Thu, 11 Jan 2001 15:43:45 -0000"' \
57 "[in-reply-to]=\<$parent\>"
58 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
59 test_expect_equal "$output" "thread:XXX 2001-01-11 [5/7] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
61 test_begin_subtest "Ignore added reply prefix (Sv:)"
62 add_message '[subject]="Sv: thread-naming: Initial thread subject"' \
63 '[date]="Fri, 12 Jan 2001 15:43:45 -0000"' \
64 "[in-reply-to]=\<$parent\>"
65 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
66 test_expect_equal "$output" "thread:XXX 2001-01-12 [6/8] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
68 test_begin_subtest 'Test order of messages in "notmuch show"'
69 output=$(notmuch show thread-naming | notmuch_show_sanitize)
70 test_expect_equal "$output" "
\fmessage{ id:msg-$(printf "%03d" $first)@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-$(printf "%03d" $first)
72 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (unread)
73 Subject: thread-naming: Initial thread subject
74 From: Notmuch Test Suite <test_suite@notmuchmail.org>
75 To: Notmuch Test Suite <test_suite@notmuchmail.org>
76 Date: Fri, 05 Jan 2001 15:43:56 -0000
79 \fpart{ ID: 1, Content-type: text/plain
80 This is just a test message (#$first)
84 \fmessage{ id:msg-$(printf "%03d" $((first + 1)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 1)))
86 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-06) (inbox unread)
87 Subject: thread-naming: Older changed subject
88 From: Notmuch Test Suite <test_suite@notmuchmail.org>
89 To: Notmuch Test Suite <test_suite@notmuchmail.org>
90 Date: Sat, 06 Jan 2001 15:43:56 -0000
93 \fpart{ ID: 1, Content-type: text/plain
94 This is just a test message (#$((first + 1)))
98 \fmessage{ id:msg-$(printf "%03d" $((first + 2)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 2)))
100 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-07) (inbox unread)
101 Subject: thread-naming: Newer changed subject
102 From: Notmuch Test Suite <test_suite@notmuchmail.org>
103 To: Notmuch Test Suite <test_suite@notmuchmail.org>
104 Date: Sun, 07 Jan 2001 15:43:56 -0000
107 \fpart{ ID: 1, Content-type: text/plain
108 This is just a test message (#$((first + 2)))
112 \fmessage{ id:msg-$(printf "%03d" $((first + 3)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 3)))
114 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-08) (unread)
115 Subject: thread-naming: Final thread subject
116 From: Notmuch Test Suite <test_suite@notmuchmail.org>
117 To: Notmuch Test Suite <test_suite@notmuchmail.org>
118 Date: Mon, 08 Jan 2001 15:43:56 -0000
121 \fpart{ ID: 1, Content-type: text/plain
122 This is just a test message (#$((first + 3)))
126 \fmessage{ id:msg-$(printf "%03d" $((first + 4)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 4)))
128 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-09) (inbox unread)
129 Subject: Re: thread-naming: Initial thread subject
130 From: Notmuch Test Suite <test_suite@notmuchmail.org>
131 To: Notmuch Test Suite <test_suite@notmuchmail.org>
132 Date: Tue, 09 Jan 2001 15:43:45 -0000
135 \fpart{ ID: 1, Content-type: text/plain
136 This is just a test message (#$((first + 4)))
140 \fmessage{ id:msg-$(printf "%03d" $((first + 5)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 5)))
142 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-10) (inbox unread)
143 Subject: Aw: thread-naming: Initial thread subject
144 From: Notmuch Test Suite <test_suite@notmuchmail.org>
145 To: Notmuch Test Suite <test_suite@notmuchmail.org>
146 Date: Wed, 10 Jan 2001 15:43:45 -0000
149 \fpart{ ID: 1, Content-type: text/plain
150 This is just a test message (#$((first + 5)))
154 \fmessage{ id:msg-$(printf "%03d" $((first + 6)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 6)))
156 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-11) (inbox unread)
157 Subject: Vs: thread-naming: Initial thread subject
158 From: Notmuch Test Suite <test_suite@notmuchmail.org>
159 To: Notmuch Test Suite <test_suite@notmuchmail.org>
160 Date: Thu, 11 Jan 2001 15:43:45 -0000
163 \fpart{ ID: 1, Content-type: text/plain
164 This is just a test message (#$((first + 6)))
168 \fmessage{ id:msg-$(printf "%03d" $((first + 7)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 7)))
170 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-12) (inbox unread)
171 Subject: Sv: thread-naming: Initial thread subject
172 From: Notmuch Test Suite <test_suite@notmuchmail.org>
173 To: Notmuch Test Suite <test_suite@notmuchmail.org>
174 Date: Fri, 12 Jan 2001 15:43:45 -0000
177 \fpart{ ID: 1, Content-type: text/plain
178 This is just a test message (#$((first + 7)))