]> git.notmuchmail.org Git - notmuch/blobdiff - test/notmuch-test
Add 'G' keybinding to folder and search view that triggers external poll
[notmuch] / test / notmuch-test
index c6703f0e52b42edfedb228423c8f9bca74275a8f..1956001254dad125cafdfd6b7460a11d1eaf71e8 100755 (executable)
@@ -168,8 +168,10 @@ pass_if_equal ()
        echo "  PASS"
     else
        echo "  FAIL"
-       echo "  Expected output: $expected"
-       echo "  Actual output:   $output"
+       testname=test-$(printf "%03d" $tests)
+       echo "$expected" > $testname.expected
+       echo "$output" > $testname.output
+       diff -u $testname.expected $testname.output || true
        test_failures=$((test_failures + 1))
     fi
 }
@@ -190,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}
@@ -504,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" "\fmessage{ id:msg-033@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-033
+\fheader{
+Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (unread)
+Subject: thread-naming: Initial thread subject
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Notmuch Test Suite <test_suite@notmuchmail.org>
+Date: Fri, 05 Jan 2001 15:43:56 -0800
+\fheader}
+\fbody{
+\fpart{ ID: 1, Content-type: text/plain
+This is just a test message (#33)
+\fpart}
+\fbody}
+\fmessage}
+\fmessage{ id:msg-034@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-034
+\fheader{
+Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-06) (inbox unread)
+Subject: thread-naming: Older changed subject
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Notmuch Test Suite <test_suite@notmuchmail.org>
+Date: Sat, 06 Jan 2001 15:43:56 -0800
+\fheader}
+\fbody{
+\fpart{ ID: 1, Content-type: text/plain
+This is just a test message (#34)
+\fpart}
+\fbody}
+\fmessage}
+\fmessage{ id:msg-035@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-035
+\fheader{
+Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-07) (inbox unread)
+Subject: thread-naming: Newer changed subject
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Notmuch Test Suite <test_suite@notmuchmail.org>
+Date: Sun, 07 Jan 2001 15:43:56 -0800
+\fheader}
+\fbody{
+\fpart{ ID: 1, Content-type: text/plain
+This is just a test message (#35)
+\fpart}
+\fbody}
+\fmessage}
+\fmessage{ id:msg-036@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-036
+\fheader{
+Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-08) (unread)
+Subject: thread-naming: Final thread subject
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Notmuch Test Suite <test_suite@notmuchmail.org>
+Date: Mon, 08 Jan 2001 15:43:56 -0800
+\fheader}
+\fbody{
+\fpart{ ID: 1, Content-type: text/plain
+This is just a test message (#36)
+\fpart}
+\fbody}
+\fmessage}
+\fmessage{ id:msg-037@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-037
+\fheader{
+Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-09) (inbox unread)
+Subject: Re: thread-naming: Initial thread subject
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Notmuch Test Suite <test_suite@notmuchmail.org>
+Date: Tue, 09 Jan 2001 15:43:45 -0800
+\fheader}
+\fbody{
+\fpart{ ID: 1, Content-type: text/plain
+This is just a test message (#37)
+\fpart}
+\fbody}
+\fmessage}
+\fmessage{ id:msg-038@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-038
+\fheader{
+Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-10) (inbox unread)
+Subject: Aw: thread-naming: Initial thread subject
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Notmuch Test Suite <test_suite@notmuchmail.org>
+Date: Wed, 10 Jan 2001 15:43:45 -0800
+\fheader}
+\fbody{
+\fpart{ ID: 1, Content-type: text/plain
+This is just a test message (#38)
+\fpart}
+\fbody}
+\fmessage}
+\fmessage{ id:msg-039@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-039
+\fheader{
+Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-11) (inbox unread)
+Subject: Vs: thread-naming: Initial thread subject
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Notmuch Test Suite <test_suite@notmuchmail.org>
+Date: Thu, 11 Jan 2001 15:43:45 -0800
+\fheader}
+\fbody{
+\fpart{ ID: 1, Content-type: text/plain
+This is just a test message (#39)
+\fpart}
+\fbody}
+\fmessage}
+\fmessage{ id:msg-040@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-040
+\fheader{
+Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-12) (inbox unread)
+Subject: Sv: thread-naming: Initial thread subject
+From: Notmuch Test Suite <test_suite@notmuchmail.org>
+To: Notmuch Test Suite <test_suite@notmuchmail.org>
+Date: Fri, 12 Jan 2001 15:43:45 -0800
+\fheader}
+\fbody{
+\fpart{ ID: 1, Content-type: text/plain
+This is just a test message (#40)
+\fpart}
+\fbody}
+\fmessage}"
+
 printf "\nTesting \"notmuch reply\" in several variations:\n"
 
 printf " Basic reply...\t\t\t\t\t"