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