2 test_description="naming of threads with changing subject"
5 test_begin_subtest "Initial thread name (oldest-first search)"
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 output=$(notmuch search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize)
21 test_expect_equal "$output" "thread:XXX 2001-01-05 [4/4] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
23 test_begin_subtest "Initial thread name (newest-first search)"
24 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
25 test_expect_equal "$output" "thread:XXX 2001-01-08 [4/4] Notmuch Test Suite; thread-naming: Final thread subject (inbox unread)"
27 # Remove oldest and newest messages from search results
28 notmuch tag -inbox id:$parent or id:$final
30 test_begin_subtest "Changed thread name (oldest-first search)"
31 output=$(notmuch search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize)
32 test_expect_equal "$output" "thread:XXX 2001-01-06 [2/4] Notmuch Test Suite; thread-naming: Older changed subject (inbox unread)"
34 test_begin_subtest "Changed thread name (newest-first search)"
35 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
36 test_expect_equal "$output" "thread:XXX 2001-01-07 [2/4] Notmuch Test Suite; thread-naming: Newer changed subject (inbox unread)"
38 test_begin_subtest "Ignore added reply prefix (Re:)"
39 add_message '[subject]="Re: thread-naming: Initial thread subject"' \
40 '[date]="Tue, 09 Jan 2001 15:43:45 -0000"' \
41 "[in-reply-to]=\<$parent\>"
42 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
43 test_expect_equal "$output" "thread:XXX 2001-01-09 [3/5] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
45 test_begin_subtest "Ignore added reply prefix (Aw:)"
46 add_message '[subject]="Aw: thread-naming: Initial thread subject"' \
47 '[date]="Wed, 10 Jan 2001 15:43:45 -0000"' \
48 "[in-reply-to]=\<$parent\>"
49 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
50 test_expect_equal "$output" "thread:XXX 2001-01-10 [4/6] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
52 test_begin_subtest "Ignore added reply prefix (Vs:)"
53 add_message '[subject]="Vs: thread-naming: Initial thread subject"' \
54 '[date]="Thu, 11 Jan 2001 15:43:45 -0000"' \
55 "[in-reply-to]=\<$parent\>"
56 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
57 test_expect_equal "$output" "thread:XXX 2001-01-11 [5/7] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
59 test_begin_subtest "Ignore added reply prefix (Sv:)"
60 add_message '[subject]="Sv: thread-naming: Initial thread subject"' \
61 '[date]="Fri, 12 Jan 2001 15:43:45 -0000"' \
62 "[in-reply-to]=\<$parent\>"
63 output=$(notmuch search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
64 test_expect_equal "$output" "thread:XXX 2001-01-12 [6/8] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
66 test_begin_subtest 'Test order of messages in "notmuch show"'
67 output=$(notmuch show thread-naming | notmuch_show_sanitize)
68 test_expect_equal "$output" "
\fmessage{ id:msg-$(printf "%03d" $first)@notmuch-test-suite depth:0 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $first)
70 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (unread)
71 Subject: thread-naming: Initial thread subject
72 From: Notmuch Test Suite <test_suite@notmuchmail.org>
73 To: Notmuch Test Suite <test_suite@notmuchmail.org>
74 Date: Fri, 05 Jan 2001 15:43:56 +0000
77 \fpart{ ID: 1, Content-type: text/plain
78 This is just a test message (#$first)
82 \fmessage{ id:msg-$(printf "%03d" $((first + 1)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 1)))
84 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-06) (inbox unread)
85 Subject: thread-naming: Older changed subject
86 From: Notmuch Test Suite <test_suite@notmuchmail.org>
87 To: Notmuch Test Suite <test_suite@notmuchmail.org>
88 Date: Sat, 06 Jan 2001 15:43:56 +0000
91 \fpart{ ID: 1, Content-type: text/plain
92 This is just a test message (#$((first + 1)))
96 \fmessage{ id:msg-$(printf "%03d" $((first + 2)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 2)))
98 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-07) (inbox unread)
99 Subject: thread-naming: Newer changed subject
100 From: Notmuch Test Suite <test_suite@notmuchmail.org>
101 To: Notmuch Test Suite <test_suite@notmuchmail.org>
102 Date: Sun, 07 Jan 2001 15:43:56 +0000
105 \fpart{ ID: 1, Content-type: text/plain
106 This is just a test message (#$((first + 2)))
110 \fmessage{ id:msg-$(printf "%03d" $((first + 3)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 3)))
112 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-08) (unread)
113 Subject: thread-naming: Final thread subject
114 From: Notmuch Test Suite <test_suite@notmuchmail.org>
115 To: Notmuch Test Suite <test_suite@notmuchmail.org>
116 Date: Mon, 08 Jan 2001 15:43:56 +0000
119 \fpart{ ID: 1, Content-type: text/plain
120 This is just a test message (#$((first + 3)))
124 \fmessage{ id:msg-$(printf "%03d" $((first + 4)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 4)))
126 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-09) (inbox unread)
127 Subject: Re: thread-naming: Initial thread subject
128 From: Notmuch Test Suite <test_suite@notmuchmail.org>
129 To: Notmuch Test Suite <test_suite@notmuchmail.org>
130 Date: Tue, 09 Jan 2001 15:43:45 +0000
133 \fpart{ ID: 1, Content-type: text/plain
134 This is just a test message (#$((first + 4)))
138 \fmessage{ id:msg-$(printf "%03d" $((first + 5)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 5)))
140 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-10) (inbox unread)
141 Subject: Aw: thread-naming: Initial thread subject
142 From: Notmuch Test Suite <test_suite@notmuchmail.org>
143 To: Notmuch Test Suite <test_suite@notmuchmail.org>
144 Date: Wed, 10 Jan 2001 15:43:45 +0000
147 \fpart{ ID: 1, Content-type: text/plain
148 This is just a test message (#$((first + 5)))
152 \fmessage{ id:msg-$(printf "%03d" $((first + 6)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 6)))
154 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-11) (inbox unread)
155 Subject: Vs: thread-naming: Initial thread subject
156 From: Notmuch Test Suite <test_suite@notmuchmail.org>
157 To: Notmuch Test Suite <test_suite@notmuchmail.org>
158 Date: Thu, 11 Jan 2001 15:43:45 +0000
161 \fpart{ ID: 1, Content-type: text/plain
162 This is just a test message (#$((first + 6)))
166 \fmessage{ id:msg-$(printf "%03d" $((first + 7)))@notmuch-test-suite depth:1 match:1 excluded:0 filename:/XXX/mail/msg-$(printf "%03d" $((first + 7)))
168 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-12) (inbox unread)
169 Subject: Sv: thread-naming: Initial thread subject
170 From: Notmuch Test Suite <test_suite@notmuchmail.org>
171 To: Notmuch Test Suite <test_suite@notmuchmail.org>
172 Date: Fri, 12 Jan 2001 15:43:45 +0000
175 \fpart{ ID: 1, Content-type: text/plain
176 This is just a test message (#$((first + 7)))