printf "\nTesting naming of threads with changing subject:\n"
add_message '[subject]="thread-naming: Initial thread subject"' \
'[date]="Fri, 05 Jan 2001 15:43:56 -0800"'
+first=${gen_msg_cnt}
parent=${gen_msg_id}
add_message '[subject]="thread-naming: Older changed subject"' \
'[date]="Sat, 06 Jan 2001 15:43:56 -0800"' \
printf " Test order of messages in \"notmuch show\"\t"
output=$($NOTMUCH show thread-naming | notmuch_show_sanitize)
-pass_if_equal "$output" "\fmessage{ id:msg-033@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-033
+pass_if_equal "$output" "\fmessage{ id:msg-$(printf "%03d" $first)@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-$(printf "%03d" $first)
\fheader{
Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (unread)
Subject: thread-naming: Initial thread subject
\fheader}
\fbody{
\fpart{ ID: 1, Content-type: text/plain
-This is just a test message (#33)
+This is just a test message (#$first)
\fpart}
\fbody}
\fmessage}
-\fmessage{ id:msg-034@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-034
+\fmessage{ id:msg-$(printf "%03d" $((first + 1)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 1)))
\fheader{
Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-06) (inbox unread)
Subject: thread-naming: Older changed subject
\fheader}
\fbody{
\fpart{ ID: 1, Content-type: text/plain
-This is just a test message (#34)
+This is just a test message (#$((first + 1)))
\fpart}
\fbody}
\fmessage}
-\fmessage{ id:msg-035@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-035
+\fmessage{ id:msg-$(printf "%03d" $((first + 2)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 2)))
\fheader{
Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-07) (inbox unread)
Subject: thread-naming: Newer changed subject
\fheader}
\fbody{
\fpart{ ID: 1, Content-type: text/plain
-This is just a test message (#35)
+This is just a test message (#$((first + 2)))
\fpart}
\fbody}
\fmessage}
-\fmessage{ id:msg-036@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-036
+\fmessage{ id:msg-$(printf "%03d" $((first + 3)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 3)))
\fheader{
Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-08) (unread)
Subject: thread-naming: Final thread subject
\fheader}
\fbody{
\fpart{ ID: 1, Content-type: text/plain
-This is just a test message (#36)
+This is just a test message (#$((first + 3)))
\fpart}
\fbody}
\fmessage}
-\fmessage{ id:msg-037@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-037
+\fmessage{ id:msg-$(printf "%03d" $((first + 4)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 4)))
\fheader{
Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-09) (inbox unread)
Subject: Re: thread-naming: Initial thread subject
\fheader}
\fbody{
\fpart{ ID: 1, Content-type: text/plain
-This is just a test message (#37)
+This is just a test message (#$((first + 4)))
\fpart}
\fbody}
\fmessage}
-\fmessage{ id:msg-038@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-038
+\fmessage{ id:msg-$(printf "%03d" $((first + 5)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 5)))
\fheader{
Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-10) (inbox unread)
Subject: Aw: thread-naming: Initial thread subject
\fheader}
\fbody{
\fpart{ ID: 1, Content-type: text/plain
-This is just a test message (#38)
+This is just a test message (#$((first + 5)))
\fpart}
\fbody}
\fmessage}
-\fmessage{ id:msg-039@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-039
+\fmessage{ id:msg-$(printf "%03d" $((first + 6)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 6)))
\fheader{
Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-11) (inbox unread)
Subject: Vs: thread-naming: Initial thread subject
\fheader}
\fbody{
\fpart{ ID: 1, Content-type: text/plain
-This is just a test message (#39)
+This is just a test message (#$((first + 6)))
\fpart}
\fbody}
\fmessage}
-\fmessage{ id:msg-040@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-040
+\fmessage{ id:msg-$(printf "%03d" $((first + 7)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 7)))
\fheader{
Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-12) (inbox unread)
Subject: Sv: thread-naming: Initial thread subject
\fheader}
\fbody{
\fpart{ ID: 1, Content-type: text/plain
-This is just a test message (#40)
+This is just a test message (#$((first + 7)))
\fpart}
\fbody}
\fmessage}"