]> git.notmuchmail.org Git - notmuch/commitdiff
Make author order tests more strict.
authorAustin Clements <amdragon@MIT.EDU>
Wed, 17 Nov 2010 19:27:59 +0000 (14:27 -0500)
committerCarl Worth <cworth@cworth.org>
Wed, 8 Dec 2010 00:21:35 +0000 (16:21 -0800)
Use varying dates in the test messages to test the order authors are
listed in.  Add tests with repeated author names and unusual date
ordering.  Most of these are broken at the moment, but will be fixed
shortly.

Edited-by: Carl Worth <cworth@cworth.org>: Also update the expected
results for existing emacs tests that currently codify the incorrect
author ordering, (and similarly note them as broken in the current
test suite).

test/author-order
test/emacs
test/emacs.expected-output/notmuch-hello-view-inbox
test/emacs.expected-output/notmuch-search-tag-inbox

index 9f0b9316ef07dde0a9b98aba34e8129c1d0e2c82..2ddc91c777e5181f2105cad39fc77b9699cc9e56 100755 (executable)
@@ -8,22 +8,22 @@ output=$(NOTMUCH_NEW)
 test_expect_equal "$output" "Added 1 new message to the database."
 
 test_begin_subtest "Adding initial child message"
-generate_message [body]=findme "[in-reply-to]=\<new-parent-id\>" [subject]=author-reorder-threadtest '[from]="User1 <user1@example.com>"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
+generate_message [body]=findme "[in-reply-to]=\<new-parent-id\>" [subject]=author-reorder-threadtest '[from]="User1 <user1@example.com>"' '[date]="Sat, 01 Jan 2000 12:01:00 -0000"'
 output=$(NOTMUCH_NEW)
 test_expect_equal "$output" "Added 1 new message to the database."
 
 test_begin_subtest "Adding second child message"
-generate_message [body]=findme "[in-reply-to]=\<new-parent-id\>" [subject]=author-reorder-threadtest '[from]="User2 <user2@example.com>"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
+generate_message [body]=findme "[in-reply-to]=\<new-parent-id\>" [subject]=author-reorder-threadtest '[from]="User2 <user2@example.com>"' '[date]="Sat, 01 Jan 2000 12:02:00 -0000"'
 output=$(NOTMUCH_NEW)
 test_expect_equal "$output" "Added 1 new message to the database."
 
 test_begin_subtest "Searching when all three messages match"
 output=$(notmuch search findme | notmuch_search_sanitize)
-test_expect_equal "$output" "thread:XXX   2000-01-01 [3/3] User, User1, User2; author-reorder-threadtest (inbox unread)"
+test_expect_equal_failure "$output" "thread:XXX   2000-01-01 [3/3] User, User1, User2; author-reorder-threadtest (inbox unread)"
 
 test_begin_subtest "Searching when two messages match"
 output=$(notmuch search User1 or User2 | notmuch_search_sanitize)
-test_expect_equal "$output" "thread:XXX   2000-01-01 [2/3] User1, User2| User; author-reorder-threadtest (inbox unread)"
+test_expect_equal_failure "$output" "thread:XXX   2000-01-01 [2/3] User1, User2| User; author-reorder-threadtest (inbox unread)"
 
 test_begin_subtest "Searching when only one message matches"
 output=$(notmuch search User2 | notmuch_search_sanitize)
@@ -33,4 +33,26 @@ test_begin_subtest "Searching when only first message matches"
 output=$(notmuch search User | notmuch_search_sanitize)
 test_expect_equal "$output" "thread:XXX   2000-01-01 [1/3] User| User1, User2; author-reorder-threadtest (inbox unread)"
 
+test_begin_subtest "Adding duplicate author"
+generate_message [body]=findme "[in-reply-to]=\<new-parent-id\>" [subject]=author-reorder-threadtest '[from]="User1 <user1@example.com>"' '[date]="Sat, 01 Jan 2000 12:03:00 -0000"'
+output=$(NOTMUCH_NEW)
+test_expect_equal "$output" "Added 1 new message to the database."
+
+test_begin_subtest "Searching when all four messages match"
+output=$(notmuch search findme | notmuch_search_sanitize)
+test_expect_equal_failure "$output" "thread:XXX   2000-01-01 [4/4] User, User1, User2; author-reorder-threadtest (inbox unread)"
+
+test_begin_subtest "Adding non-monotonic child message"
+generate_message [body]=findme "[in-reply-to]=\<new-parent-id\>" [subject]=author-reorder-threadtest '[from]="User0 <user0@example.com>"' '[date]="Sat, 01 Jan 2000 11:00:00 -0000"'
+output=$(NOTMUCH_NEW)
+test_expect_equal "$output" "Added 1 new message to the database."
+
+test_begin_subtest "Searching non-monotonic messages (oldest-first)"
+output=$(notmuch search --sort=oldest-first findme | notmuch_search_sanitize)
+test_expect_equal_failure "$output" "thread:XXX   2000-01-01 [5/5] User0, User, User1, User2; author-reorder-threadtest (inbox unread)"
+
+test_begin_subtest "Searching non-monotonic messages (newest-first)"
+output=$(notmuch search --sort=newest-first findme | notmuch_search_sanitize)
+test_expect_equal_failure "$output" "thread:XXX   2000-01-01 [5/5] User0, User, User1, User2; author-reorder-threadtest (inbox unread)"
+
 test_done
index 75dec89c965e814a2c68e5fc352b5540564b2c4f..fd5ae07f1a1a5bdf7c7d46546dd9513ecafdadbe 100755 (executable)
@@ -24,12 +24,12 @@ test_expect_equal "$output" "$expected"
 test_begin_subtest "Basic notmuch-search view in emacs"
 output=$(test_emacs '(notmuch-search "tag:inbox") (notmuch-test-wait) (message (buffer-string))' 2>&1)
 expected=$(cat $EXPECTED/notmuch-search-tag-inbox)
-test_expect_equal "$output" "$expected"
+test_expect_equal_failure "$output" "$expected"
 
 test_begin_subtest "Navigation of notmuch-hello to search results"
 output=$(test_emacs '(notmuch-hello) (goto-char (point-min)) (re-search-forward "inbox") (widget-button-press (point)) (notmuch-test-wait) (message (buffer-string))' 2>&1)
 expected=$(cat $EXPECTED/notmuch-hello-view-inbox)
-test_expect_equal "$output" "$expected"
+test_expect_equal_failure "$output" "$expected"
 
 test_begin_subtest "Basic notmuch-show view in emacs"
 maildir_storage_thread=$(notmuch search --output=threads id:20091117190054.GU3165@dottiness.seas.harvard.edu)
index 924f7ef94d1153d7376d2e66201756edf117025e..6472c465cfdf6e60f6014eff5b8d1059e108c4db 100644 (file)
@@ -1,23 +1,23 @@
-  2009-11-17 [5/5]   Carl Worth, Keith Packard, Mikhail Gusarov       [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread)
-  2009-11-17 [7/7]   Carl Worth, Lars Kellogg-Stedman, Keith Packard, Mikhail Gusarov       [notmuch] Working with Maildir storage? (inbox unread)
-  2009-11-17 [2/2]   Carl Worth, Alex Botero-Lowry       [notmuch] preliminary FreeBSD support (attachment inbox unread)
+  2009-11-17 [5/5]   Mikhail Gusarov, Carl Worth, Keith Packard  [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread)
+  2009-11-17 [7/7]   Lars Kellogg-Stedman, Mikhail Gusarov, Keith Packard, Carl Worth  [notmuch] Working with Maildir storage? (inbox unread)
+  2009-11-17 [2/2]   Alex Botero-Lowry, Carl Worth  [notmuch] preliminary FreeBSD support (attachment inbox unread)
   2009-11-17 [1/1]   Mikhail Gusarov      [notmuch] [PATCH] Handle rename of message file (inbox unread)
-  2009-11-17 [2/2]   Carl Worth, Keith Packard       [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread)
-  2009-11-17 [2/2]   Carl Worth, Jan Janak       [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread)
-  2009-11-17 [3/3]   Carl Worth, Jan Janak       [notmuch] What a great idea! (inbox unread)
-  2009-11-17 [3/3]   Carl Worth, Keith Packard, Israel Herraiz       [notmuch] New to the list (inbox unread)
-  2009-11-17 [3/3]   Carl Worth, Keith Packard, Adrian Perez de Castro       [notmuch] Introducing myself (inbox unread)
-  2009-11-17 [3/3]   Carl Worth, Keith Packard, Aron Griffis       [notmuch] archive (inbox unread)
-  2009-11-17 [2/2]   Carl Worth, Ingmar Vanhassel       [notmuch] [PATCH] Typsos (inbox unread)
-  2009-11-18 [2/2]   Carl Worth, Alex Botero-Lowry       [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread)
+  2009-11-17 [2/2]   Keith Packard, Carl Worth    [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread)
+  2009-11-17 [2/2]   Jan Janak, Carl Worth        [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread)
+  2009-11-17 [3/3]   Jan Janak, Carl Worth        [notmuch] What a great idea! (inbox unread)
+  2009-11-17 [3/3]   Israel Herraiz, Keith Packard, Carl Worth   [notmuch] New to the list (inbox unread)
+  2009-11-17 [3/3]   Adrian Perez de Castro, Keith Packard, Carl Worth  [notmuch] Introducing myself (inbox unread)
+  2009-11-17 [3/3]   Aron Griffis, Keith Packard, Carl Worth     [notmuch] archive (inbox unread)
+  2009-11-17 [2/2]   Ingmar Vanhassel, Carl Worth  [notmuch] [PATCH] Typsos (inbox unread)
+  2009-11-18 [2/2]   Alex Botero-Lowry, Carl Worth  [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread)
   2009-11-18 [2/2]   Lars Kellogg-Stedman [notmuch] "notmuch help" outputs to stderr? (attachment inbox unread)
   2009-11-18 [1/1]   Stewart Smith        [notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (inbox unread)
   2009-11-18 [1/1]   Stewart Smith        [notmuch] [PATCH 2/2] Read mail directory in inode number order (inbox unread)
   2009-11-18 [1/1]   Stewart Smith        [notmuch] [PATCH] count_files: sort directory in inode order before statting (inbox unread)
-  2009-11-18 [4/4]   Alexander Botero-Lowry, Jjgod Jiang  [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)
+  2009-11-18 [4/4]   Jjgod Jiang, Alexander Botero-Lowry      [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)
   2009-11-18 [1/1]   Jan Janak            [notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread)
   2009-11-18 [1/1]   Rolland Santimano    [notmuch] Link to mailing list archives ? (inbox unread)
   2009-11-18 [1/1]   Alexander Botero-Lowry  [notmuch] request for pull (inbox unread)
-  2009-11-18 [2/2]   Alexander Botero-Lowry, Keith Packard  [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread)
+  2009-11-18 [2/2]   Keith Packard, Alexander Botero-Lowry    [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread)
   2009-11-18 [1/1]   Chris Wilson         [notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once (inbox unread)
 End of search results.
index 15a0d2b9ba2127a029e4bf89673b392684b0e80c..21681596ccfbe4fd0787ebc71b4981548e2d7279 100644 (file)
@@ -1,17 +1,17 @@
   2009-11-18 [1/1]   Chris Wilson         [notmuch] [PATCH 1/2] Makefile: evaluate pkg-config once (inbox unread)
-  2009-11-18 [2/2]   Carl Worth, Alex Botero-Lowry       [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread)
-  2009-11-18 [2/2]   Carl Worth, Ingmar Vanhassel       [notmuch] [PATCH] Typsos (inbox unread)
-  2009-11-18 [3/3]   Carl Worth, Keith Packard, Adrian Perez de Castro       [notmuch] Introducing myself (inbox unread)
-  2009-11-18 [3/3]   Carl Worth, Keith Packard, Israel Herraiz       [notmuch] New to the list (inbox unread)
-  2009-11-18 [3/3]   Carl Worth, Jan Janak       [notmuch] What a great idea! (inbox unread)
-  2009-11-18 [2/2]   Carl Worth, Jan Janak       [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread)
-  2009-11-18 [3/3]   Carl Worth, Keith Packard, Aron Griffis       [notmuch] archive (inbox unread)
-  2009-11-18 [2/2]   Carl Worth, Keith Packard       [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread)
-  2009-11-18 [7/7]   Carl Worth, Lars Kellogg-Stedman, Keith Packard, Mikhail Gusarov       [notmuch] Working with Maildir storage? (inbox unread)
-  2009-11-18 [5/5]   Carl Worth, Keith Packard, Mikhail Gusarov       [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread)
-  2009-11-18 [2/2]   Alexander Botero-Lowry, Keith Packard  [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread)
+  2009-11-18 [2/2]   Alex Botero-Lowry, Carl Worth  [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread)
+  2009-11-18 [2/2]   Ingmar Vanhassel, Carl Worth  [notmuch] [PATCH] Typsos (inbox unread)
+  2009-11-18 [3/3]   Adrian Perez de Castro, Keith Packard, Carl Worth  [notmuch] Introducing myself (inbox unread)
+  2009-11-18 [3/3]   Israel Herraiz, Keith Packard, Carl Worth   [notmuch] New to the list (inbox unread)
+  2009-11-18 [3/3]   Jan Janak, Carl Worth        [notmuch] What a great idea! (inbox unread)
+  2009-11-18 [2/2]   Jan Janak, Carl Worth        [notmuch] [PATCH] Older versions of install do not support -C. (inbox unread)
+  2009-11-18 [3/3]   Aron Griffis, Keith Packard, Carl Worth     [notmuch] archive (inbox unread)
+  2009-11-18 [2/2]   Keith Packard, Carl Worth    [notmuch] [PATCH] Make notmuch-show 'X' (and 'x') commands remove inbox (and unread) tags (inbox unread)
+  2009-11-18 [7/7]   Lars Kellogg-Stedman, Mikhail Gusarov, Keith Packard, Carl Worth  [notmuch] Working with Maildir storage? (inbox unread)
+  2009-11-18 [5/5]   Mikhail Gusarov, Carl Worth, Keith Packard  [notmuch] [PATCH 1/2] Close message file after parsing message headers (inbox unread)
+  2009-11-18 [2/2]   Keith Packard, Alexander Botero-Lowry    [notmuch] [PATCH] Create a default notmuch-show-hook that highlights URLs and uses word-wrap (inbox unread)
   2009-11-18 [1/1]   Alexander Botero-Lowry  [notmuch] request for pull (inbox unread)
-  2009-11-18 [4/4]   Alexander Botero-Lowry, Jjgod Jiang  [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)
+  2009-11-18 [4/4]   Jjgod Jiang, Alexander Botero-Lowry      [notmuch] Mac OS X/Darwin compatibility issues (inbox unread)
   2009-11-18 [1/1]   Rolland Santimano    [notmuch] Link to mailing list archives ? (inbox unread)
   2009-11-18 [1/1]   Jan Janak            [notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags (inbox unread)
   2009-11-18 [1/1]   Stewart Smith        [notmuch] [PATCH] count_files: sort directory in inode order before statting (inbox unread)
@@ -19,5 +19,5 @@
   2009-11-18 [1/1]   Stewart Smith        [notmuch] [PATCH] Fix linking with gcc to use g++ to link in C++ libs. (inbox unread)
   2009-11-18 [2/2]   Lars Kellogg-Stedman [notmuch] "notmuch help" outputs to stderr? (attachment inbox unread)
   2009-11-17 [1/1]   Mikhail Gusarov      [notmuch] [PATCH] Handle rename of message file (inbox unread)
-  2009-11-17 [2/2]   Carl Worth, Alex Botero-Lowry       [notmuch] preliminary FreeBSD support (attachment inbox unread)
+  2009-11-17 [2/2]   Alex Botero-Lowry, Carl Worth  [notmuch] preliminary FreeBSD support (attachment inbox unread)
 End of search results.