From: Carl Worth Date: Thu, 22 Apr 2010 20:26:37 +0000 (-0700) Subject: test: Add a test to demonstrate message-sorting regression. X-Git-Tag: 0.3~117 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5106df9f6b3101eb1ea4250efefa3f0408acbfc6;p=notmuch.git test: Add a test to demonstrate message-sorting regression. In the recent change to rename threads based on changing subject lines, I broke message ordering within "notmuch show" output. But our test suite didn't catch that regressions, because we didn't have any tests of "notmuch show". This adds one "notmuch show" test along with the thread-naming tests. It's not a whole suite of "notmuch show" testing, but it does catch this regression at least. --- diff --git a/test/notmuch-test b/test/notmuch-test index 676b66ec..19560012 100755 --- a/test/notmuch-test +++ b/test/notmuch-test @@ -192,6 +192,12 @@ notmuch_search_sanitize () sed -e "$NOTMUCH_SEARCH_THREAD_ID_SQUELCH" } +NOTMUCH_SHOW_FILENAME_SQUELCH='s,filename:.*/mail,filename:/XXX/mail,' +notmuch_show_sanitize () +{ + sed -e "$NOTMUCH_SHOW_FILENAME_SQUELCH" +} + rm -rf ${TEST_DIR} mkdir ${TEST_DIR} cd ${TEST_DIR} @@ -506,6 +512,121 @@ add_message '[subject]="Sv: thread-naming: Initial thread subject"' \ output=$($NOTMUCH search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize) pass_if_equal "$output" "thread:XXX 2001-01-12 [6/8] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)" +printf " Test order of messages in \"notmuch show\"\t" +output=$($NOTMUCH show thread-naming | notmuch_show_sanitize) +pass_if_equal "$output" " message{ id:msg-033@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-033 + header{ +Notmuch Test Suite (2001-01-05) (unread) +Subject: thread-naming: Initial thread subject +From: Notmuch Test Suite +To: Notmuch Test Suite +Date: Fri, 05 Jan 2001 15:43:56 -0800 + header} + body{ + part{ ID: 1, Content-type: text/plain +This is just a test message (#33) + part} + body} + message} + message{ id:msg-034@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-034 + header{ +Notmuch Test Suite (2001-01-06) (inbox unread) +Subject: thread-naming: Older changed subject +From: Notmuch Test Suite +To: Notmuch Test Suite +Date: Sat, 06 Jan 2001 15:43:56 -0800 + header} + body{ + part{ ID: 1, Content-type: text/plain +This is just a test message (#34) + part} + body} + message} + message{ id:msg-035@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-035 + header{ +Notmuch Test Suite (2001-01-07) (inbox unread) +Subject: thread-naming: Newer changed subject +From: Notmuch Test Suite +To: Notmuch Test Suite +Date: Sun, 07 Jan 2001 15:43:56 -0800 + header} + body{ + part{ ID: 1, Content-type: text/plain +This is just a test message (#35) + part} + body} + message} + message{ id:msg-036@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-036 + header{ +Notmuch Test Suite (2001-01-08) (unread) +Subject: thread-naming: Final thread subject +From: Notmuch Test Suite +To: Notmuch Test Suite +Date: Mon, 08 Jan 2001 15:43:56 -0800 + header} + body{ + part{ ID: 1, Content-type: text/plain +This is just a test message (#36) + part} + body} + message} + message{ id:msg-037@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-037 + header{ +Notmuch Test Suite (2001-01-09) (inbox unread) +Subject: Re: thread-naming: Initial thread subject +From: Notmuch Test Suite +To: Notmuch Test Suite +Date: Tue, 09 Jan 2001 15:43:45 -0800 + header} + body{ + part{ ID: 1, Content-type: text/plain +This is just a test message (#37) + part} + body} + message} + message{ id:msg-038@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-038 + header{ +Notmuch Test Suite (2001-01-10) (inbox unread) +Subject: Aw: thread-naming: Initial thread subject +From: Notmuch Test Suite +To: Notmuch Test Suite +Date: Wed, 10 Jan 2001 15:43:45 -0800 + header} + body{ + part{ ID: 1, Content-type: text/plain +This is just a test message (#38) + part} + body} + message} + message{ id:msg-039@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-039 + header{ +Notmuch Test Suite (2001-01-11) (inbox unread) +Subject: Vs: thread-naming: Initial thread subject +From: Notmuch Test Suite +To: Notmuch Test Suite +Date: Thu, 11 Jan 2001 15:43:45 -0800 + header} + body{ + part{ ID: 1, Content-type: text/plain +This is just a test message (#39) + part} + body} + message} + message{ id:msg-040@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-040 + header{ +Notmuch Test Suite (2001-01-12) (inbox unread) +Subject: Sv: thread-naming: Initial thread subject +From: Notmuch Test Suite +To: Notmuch Test Suite +Date: Fri, 12 Jan 2001 15:43:45 -0800 + header} + body{ + part{ ID: 1, Content-type: text/plain +This is just a test message (#40) + part} + body} + message}" + printf "\nTesting \"notmuch reply\" in several variations:\n" printf " Basic reply...\t\t\t\t\t"