Re: [PATCH 9/9] add has: query prefix to search for specific properties
[notmuch-archives.git] / 00 / 048b946a70c512f89b9f9326fb5c5637f856f9
1 Return-Path: <dkg@fifthhorseman.net>\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 arlo.cworth.org (Postfix) with ESMTP id D46BA6DE02DD\r
6  for <notmuch@notmuchmail.org>; Sat,  2 Apr 2016 07:15:55 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.732\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.732 tagged_above=-999 required=5\r
12  tests=[AWL=-0.732] autolearn=disabled\r
13 Received: from arlo.cworth.org ([127.0.0.1])\r
14  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
15  with ESMTP id z9Rk9reRS0wE for <notmuch@notmuchmail.org>;\r
16  Sat,  2 Apr 2016 07:15:47 -0700 (PDT)\r
17 Received: from che.mayfirst.org (che.mayfirst.org [209.234.253.108])\r
18  by arlo.cworth.org (Postfix) with ESMTP id B818C6DE02C2\r
19  for <notmuch@notmuchmail.org>; Sat,  2 Apr 2016 07:15:47 -0700 (PDT)\r
20 Received: from fifthhorseman.net (dhcp-a244.meeting.ietf.org [31.133.162.68])\r
21  by che.mayfirst.org (Postfix) with ESMTPSA id 81238F99A\r
22  for <notmuch@notmuchmail.org>; Sat,  2 Apr 2016 10:15:45 -0400 (EDT)\r
23 Received: by fifthhorseman.net (Postfix, from userid 1000)\r
24  id A4F441FD2C; Sat,  2 Apr 2016 11:15:41 -0300 (BRT)\r
25 From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
26 To: Notmuch Mail <notmuch@notmuchmail.org>\r
27 Subject: [PATCH v2 2/7] verify during thread-breakage that messages are\r
28  removed as well\r
29 Date: Sat,  2 Apr 2016 11:15:36 -0300\r
30 Message-Id: <1459606541-23889-2-git-send-email-dkg@fifthhorseman.net>\r
31 X-Mailer: git-send-email 2.8.0.rc3\r
32 In-Reply-To: <1459606541-23889-1-git-send-email-dkg@fifthhorseman.net>\r
33 References: <1459445693-3900-1-git-send-email-dkg@fifthhorseman.net>\r
34  <1459606541-23889-1-git-send-email-dkg@fifthhorseman.net>\r
35 X-BeenThere: notmuch@notmuchmail.org\r
36 X-Mailman-Version: 2.1.20\r
37 Precedence: list\r
38 List-Id: "Use and development of the notmuch mail system."\r
39  <notmuch.notmuchmail.org>\r
40 List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
41  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
42 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
43 List-Post: <mailto:notmuch@notmuchmail.org>\r
44 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
45 List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
46  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
47 X-List-Received-Date: Sat, 02 Apr 2016 14:15:55 -0000\r
48 \r
49 One risk of fixes to the thread-breakage problem is that we could fail\r
50 to remove the search term indexes entirely.  These additional subtests\r
51 should guard against that.\r
52 ---\r
53  test/T590-thread-breakage.sh | 17 +++++++++++++++++\r
54  1 file changed, 17 insertions(+)\r
55 \r
56 diff --git a/test/T590-thread-breakage.sh b/test/T590-thread-breakage.sh\r
57 index 704f504..f3e725c 100755\r
58 --- a/test/T590-thread-breakage.sh\r
59 +++ b/test/T590-thread-breakage.sh\r
60 @@ -17,6 +17,7 @@ To: Bob <bob@example.net>\r
61  Date: Thu, 31 Mar 2016 20:10:00 -0400\r
62  \r
63  This is the first message in the thread.\r
64 +Apple\r
65  EOF\r
66  }\r
67  \r
68 @@ -32,10 +33,18 @@ To: Alice <alice@example.net>\r
69  Date: Thu, 31 Mar 2016 20:15:00 -0400\r
70  \r
71  This is the second message in the thread.\r
72 +Banana\r
73  EOF\r
74  }\r
75  \r
76  \r
77 +test_subject_count() {\r
78 +    notmuch new >/dev/null\r
79 +    test_begin_subtest "${3:-looking for $2 instance of '$1'}"\r
80 +    count=$(notmuch count --output=threads "$1")\r
81 +    test_expect_equal "$count" "$2"\r
82 +}\r
83 +\r
84  test_thread_count() {\r
85      notmuch new >/dev/null\r
86      test_begin_subtest "${2:-Expecting $1 thread(s)}"\r
87 @@ -47,17 +56,25 @@ test_thread_count 0 'There should be no threads initially'\r
88  \r
89  message_a\r
90  test_thread_count 1 'One message in: one thread'\r
91 +test_subject_count apple 1\r
92 +test_subject_count banana 0\r
93  \r
94  message_b\r
95  test_thread_count 1 'Second message in the same thread: one thread'\r
96 +test_subject_count apple 1\r
97 +test_subject_count banana 1\r
98  \r
99  rm -f ${MAIL_DIR}/cur/a\r
100  test_thread_count 1 'First message removed: still only one thread'\r
101 +test_subject_count apple 0\r
102 +test_subject_count banana 1\r
103  \r
104  message_a\r
105  # this is known to fail (it shows 2 threads) because no "ghost\r
106  # message" was created for message A when it was removed from the\r
107  # index, despite message B still pointing to it.\r
108  test_thread_count 1 'First message reappears: should return to the same thread'\r
109 +test_subject_count apple 1\r
110 +test_subject_count banana 1\r
111  \r
112  test_done\r
113 -- \r
114 2.8.0.rc3\r
115 \r