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\>"
20 test_expect_equal '' ''
22 test_begin_subtest "Initial thread name (oldest-first search)"
23 output=$(notmuch search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize)
24 test_expect_equal "$output" "thread:XXX 2001-01-05 [4/4] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
26 test_begin_subtest "Initial thread name (newest-first search)"
27 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
28 test_expect_equal "$output" "thread:XXX 2001-01-08 [4/4] Notmuch Test Suite; thread-naming: Final thread subject (inbox unread)"
30 # Remove oldest and newest messages from search results
31 notmuch tag -inbox id:$parent or id:$final
33 test_begin_subtest "Changed thread name (oldest-first search)"
34 output=$(notmuch search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize)
35 test_expect_equal "$output" "thread:XXX 2001-01-06 [2/4] Notmuch Test Suite; thread-naming: Older changed subject (inbox unread)"
37 test_begin_subtest "Changed thread name (newest-first search)"
38 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
39 test_expect_equal "$output" "thread:XXX 2001-01-07 [2/4] Notmuch Test Suite; thread-naming: Newer changed subject (inbox unread)"
41 test_begin_subtest "Ignore added reply prefix (Re:)"
42 add_message '[subject]="Re: thread-naming: Initial thread subject"' \
43 '[date]="Tue, 09 Jan 2001 15:43:45 -0000"' \
44 "[in-reply-to]=\<$parent\>"
45 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
46 test_expect_equal "$output" "thread:XXX 2001-01-09 [3/5] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
48 test_begin_subtest "Ignore added reply prefix (Aw:)"
49 add_message '[subject]="Aw: thread-naming: Initial thread subject"' \
50 '[date]="Wed, 10 Jan 2001 15:43:45 -0000"' \
51 "[in-reply-to]=\<$parent\>"
52 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
53 test_expect_equal "$output" "thread:XXX 2001-01-10 [4/6] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
55 test_begin_subtest "Ignore added reply prefix (Vs:)"
56 add_message '[subject]="Vs: thread-naming: Initial thread subject"' \
57 '[date]="Thu, 11 Jan 2001 15:43:45 -0000"' \
58 "[in-reply-to]=\<$parent\>"
59 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
60 test_expect_equal "$output" "thread:XXX 2001-01-11 [5/7] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
62 test_begin_subtest "Ignore added reply prefix (Sv:)"
63 add_message '[subject]="Sv: thread-naming: Initial thread subject"' \
64 '[date]="Fri, 12 Jan 2001 15:43:45 -0000"' \
65 "[in-reply-to]=\<$parent\>"
66 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
67 test_expect_equal "$output" "thread:XXX 2001-01-12 [6/8] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
69 test_begin_subtest 'Test order of messages in "notmuch show"'
70 output=$(notmuch show thread-naming | notmuch_show_sanitize)
71 test_expect_equal "$output" "
\fmessage{ id:msg-$(printf "%03d" $first)@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-$(printf "%03d" $first)
73 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (unread)
74 Subject: thread-naming: Initial thread subject
75 From: Notmuch Test Suite <test_suite@notmuchmail.org>
76 To: Notmuch Test Suite <test_suite@notmuchmail.org>
77 Date: Fri, 05 Jan 2001 15:43:56 -0000
80 \fpart{ ID: 1, Content-type: text/plain
81 This is just a test message (#$first)
85 \fmessage{ id:msg-$(printf "%03d" $((first + 1)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 1)))
87 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-06) (inbox unread)
88 Subject: thread-naming: Older changed subject
89 From: Notmuch Test Suite <test_suite@notmuchmail.org>
90 To: Notmuch Test Suite <test_suite@notmuchmail.org>
91 Date: Sat, 06 Jan 2001 15:43:56 -0000
94 \fpart{ ID: 1, Content-type: text/plain
95 This is just a test message (#$((first + 1)))
99 \fmessage{ id:msg-$(printf "%03d" $((first + 2)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 2)))
101 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-07) (inbox unread)
102 Subject: thread-naming: Newer changed subject
103 From: Notmuch Test Suite <test_suite@notmuchmail.org>
104 To: Notmuch Test Suite <test_suite@notmuchmail.org>
105 Date: Sun, 07 Jan 2001 15:43:56 -0000
108 \fpart{ ID: 1, Content-type: text/plain
109 This is just a test message (#$((first + 2)))
113 \fmessage{ id:msg-$(printf "%03d" $((first + 3)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 3)))
115 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-08) (unread)
116 Subject: thread-naming: Final thread subject
117 From: Notmuch Test Suite <test_suite@notmuchmail.org>
118 To: Notmuch Test Suite <test_suite@notmuchmail.org>
119 Date: Mon, 08 Jan 2001 15:43:56 -0000
122 \fpart{ ID: 1, Content-type: text/plain
123 This is just a test message (#$((first + 3)))
127 \fmessage{ id:msg-$(printf "%03d" $((first + 4)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 4)))
129 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-09) (inbox unread)
130 Subject: Re: thread-naming: Initial thread subject
131 From: Notmuch Test Suite <test_suite@notmuchmail.org>
132 To: Notmuch Test Suite <test_suite@notmuchmail.org>
133 Date: Tue, 09 Jan 2001 15:43:45 -0000
136 \fpart{ ID: 1, Content-type: text/plain
137 This is just a test message (#$((first + 4)))
141 \fmessage{ id:msg-$(printf "%03d" $((first + 5)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 5)))
143 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-10) (inbox unread)
144 Subject: Aw: thread-naming: Initial thread subject
145 From: Notmuch Test Suite <test_suite@notmuchmail.org>
146 To: Notmuch Test Suite <test_suite@notmuchmail.org>
147 Date: Wed, 10 Jan 2001 15:43:45 -0000
150 \fpart{ ID: 1, Content-type: text/plain
151 This is just a test message (#$((first + 5)))
155 \fmessage{ id:msg-$(printf "%03d" $((first + 6)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 6)))
157 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-11) (inbox unread)
158 Subject: Vs: thread-naming: Initial thread subject
159 From: Notmuch Test Suite <test_suite@notmuchmail.org>
160 To: Notmuch Test Suite <test_suite@notmuchmail.org>
161 Date: Thu, 11 Jan 2001 15:43:45 -0000
164 \fpart{ ID: 1, Content-type: text/plain
165 This is just a test message (#$((first + 6)))
169 \fmessage{ id:msg-$(printf "%03d" $((first + 7)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 7)))
171 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-12) (inbox unread)
172 Subject: Sv: thread-naming: Initial thread subject
173 From: Notmuch Test Suite <test_suite@notmuchmail.org>
174 To: Notmuch Test Suite <test_suite@notmuchmail.org>
175 Date: Fri, 12 Jan 2001 15:43:45 -0000
178 \fpart{ ID: 1, Content-type: text/plain
179 This is just a test message (#$((first + 7)))