Re: search by date range
[notmuch-archives.git] / 47 / a5955c427179cc2602e6b3351c4d2b0e1785d4
1 Return-Path: <amdragon@mit.edu>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 330D840DEFB\r
6         for <notmuch@notmuchmail.org>; Wed, 17 Nov 2010 11:33:13 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id Le2cASQ1ndfR for <notmuch@notmuchmail.org>;\r
16         Wed, 17 Nov 2010 11:33:02 -0800 (PST)\r
17 X-Greylist: delayed 300 seconds by postgrey-1.32 at olra;\r
18         Wed, 17 Nov 2010 11:33:02 PST\r
19 Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU\r
20         [18.7.68.34])\r
21         by olra.theworths.org (Postfix) with ESMTP id B4E8B40DEF0\r
22         for <notmuch@notmuchmail.org>; Wed, 17 Nov 2010 11:33:02 -0800 (PST)\r
23 X-AuditID: 12074422-b7c3eae000000a70-e8-4ce42cc1799e\r
24 Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
25         by dmz-mailsec-scanner-5.mit.edu (Symantec Brightmail Gateway) with\r
26         SMTP id FC.E7.02672.1CC24EC4; Wed, 17 Nov 2010 14:28:01 -0500 (EST)\r
27 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
28         by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id oAHJS0ah006234\r
29         for <notmuch@notmuchmail.org>; Wed, 17 Nov 2010 14:28:01 -0500\r
30 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
31         (authenticated bits=0)\r
32         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
33         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id oAHJRxNx007532\r
34         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)\r
35         for <notmuch@notmuchmail.org>; Wed, 17 Nov 2010 14:28:00 -0500 (EST)\r
36 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.72)\r
37         (envelope-from <amdragon@mit.edu>) id 1PInfj-0001ED-Bh\r
38         for notmuch@notmuchmail.org; Wed, 17 Nov 2010 14:27:59 -0500\r
39 Date: Wed, 17 Nov 2010 14:27:59 -0500\r
40 From: Austin Clements <amdragon@MIT.EDU>\r
41 To: notmuch@notmuchmail.org\r
42 Subject: [PATCH 2/4] Make author order tests more strict.\r
43 Message-ID: <20101117192759.GT2439@mit.edu>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 Content-Disposition: inline\r
47 User-Agent: Mutt/1.5.20 (2009-06-14)\r
48 X-Brightmail-Tracker: AAAAAA==\r
49 X-BeenThere: notmuch@notmuchmail.org\r
50 X-Mailman-Version: 2.1.13\r
51 Precedence: list\r
52 List-Id: "Use and development of the notmuch mail system."\r
53         <notmuch.notmuchmail.org>\r
54 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
55         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
56 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
57 List-Post: <mailto:notmuch@notmuchmail.org>\r
58 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
59 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
60         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
61 X-List-Received-Date: Wed, 17 Nov 2010 19:33:13 -0000\r
62 \r
63 Use varying dates in the test messages to test the order authors are\r
64 listed in.  Add tests with repeated author names and unusual date\r
65 ordering.  Most of these are broken at the moment, but will be fixed\r
66 shortly.\r
67 ---\r
68  test/author-order |   30 ++++++++++++++++++++++++++----\r
69  1 files changed, 26 insertions(+), 4 deletions(-)\r
70 \r
71 diff --git a/test/author-order b/test/author-order\r
72 index 9f0b931..2ddc91c 100755\r
73 --- a/test/author-order\r
74 +++ b/test/author-order\r
75 @@ -8,22 +8,22 @@ output=$(NOTMUCH_NEW)\r
76  test_expect_equal "$output" "Added 1 new message to the database."\r
77  \r
78  test_begin_subtest "Adding initial child message"\r
79 -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"'\r
80 +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"'\r
81  output=$(NOTMUCH_NEW)\r
82  test_expect_equal "$output" "Added 1 new message to the database."\r
83  \r
84  test_begin_subtest "Adding second child message"\r
85 -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"'\r
86 +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"'\r
87  output=$(NOTMUCH_NEW)\r
88  test_expect_equal "$output" "Added 1 new message to the database."\r
89  \r
90  test_begin_subtest "Searching when all three messages match"\r
91  output=$(notmuch search findme | notmuch_search_sanitize)\r
92 -test_expect_equal "$output" "thread:XXX   2000-01-01 [3/3] User, User1, User2; author-reorder-threadtest (inbox unread)"\r
93 +test_expect_equal_failure "$output" "thread:XXX   2000-01-01 [3/3] User, User1, User2; author-reorder-threadtest (inbox unread)"\r
94  \r
95  test_begin_subtest "Searching when two messages match"\r
96  output=$(notmuch search User1 or User2 | notmuch_search_sanitize)\r
97 -test_expect_equal "$output" "thread:XXX   2000-01-01 [2/3] User1, User2| User; author-reorder-threadtest (inbox unread)"\r
98 +test_expect_equal_failure "$output" "thread:XXX   2000-01-01 [2/3] User1, User2| User; author-reorder-threadtest (inbox unread)"\r
99  \r
100  test_begin_subtest "Searching when only one message matches"\r
101  output=$(notmuch search User2 | notmuch_search_sanitize)\r
102 @@ -33,4 +33,26 @@ test_begin_subtest "Searching when only first message matches"\r
103  output=$(notmuch search User | notmuch_search_sanitize)\r
104  test_expect_equal "$output" "thread:XXX   2000-01-01 [1/3] User| User1, User2; author-reorder-threadtest (inbox unread)"\r
105  \r
106 +test_begin_subtest "Adding duplicate author"\r
107 +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"'\r
108 +output=$(NOTMUCH_NEW)\r
109 +test_expect_equal "$output" "Added 1 new message to the database."\r
110 +\r
111 +test_begin_subtest "Searching when all four messages match"\r
112 +output=$(notmuch search findme | notmuch_search_sanitize)\r
113 +test_expect_equal_failure "$output" "thread:XXX   2000-01-01 [4/4] User, User1, User2; author-reorder-threadtest (inbox unread)"\r
114 +\r
115 +test_begin_subtest "Adding non-monotonic child message"\r
116 +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"'\r
117 +output=$(NOTMUCH_NEW)\r
118 +test_expect_equal "$output" "Added 1 new message to the database."\r
119 +\r
120 +test_begin_subtest "Searching non-monotonic messages (oldest-first)"\r
121 +output=$(notmuch search --sort=oldest-first findme | notmuch_search_sanitize)\r
122 +test_expect_equal_failure "$output" "thread:XXX   2000-01-01 [5/5] User0, User, User1, User2; author-reorder-threadtest (inbox unread)"\r
123 +\r
124 +test_begin_subtest "Searching non-monotonic messages (newest-first)"\r
125 +output=$(notmuch search --sort=newest-first findme | notmuch_search_sanitize)\r
126 +test_expect_equal_failure "$output" "thread:XXX   2000-01-01 [5/5] User0, User, User1, User2; author-reorder-threadtest (inbox unread)"\r
127 +\r
128  test_done\r
129 -- \r
130 1.7.2.3\r
131 \r