[PATCH 6/8] CLI: refactor dumping of tags.
[notmuch-archives.git] / 57 / 0046d9dbae6d4ca6cc4be88ea8e32ca62bbcdf
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 08585431FBF\r
6         for <notmuch@notmuchmail.org>; Sat, 17 May 2014 13:46:13 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 dkUZwSfrVFei for <notmuch@notmuchmail.org>;\r
16         Sat, 17 May 2014 13:46:06 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-5.mit.edu (dmz-mailsec-scanner-5.mit.edu\r
18         [18.7.68.34])\r
19         by olra.theworths.org (Postfix) with ESMTP id 61A7D431FBC\r
20         for <notmuch@notmuchmail.org>; Sat, 17 May 2014 13:46:06 -0700 (PDT)\r
21 X-AuditID: 12074422-f79376d000000c58-88-5377ca8cb1dd\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
23         (using TLS with cipher AES256-SHA (256/256 bits))\r
24         (Client did not present a certificate)\r
25         by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP\r
26         id E9.9D.03160.C8AC7735; Sat, 17 May 2014 16:46:04 -0400 (EDT)\r
27 Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
28         by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id s4HKjww4017387; \r
29         Sat, 17 May 2014 16:45:59 -0400\r
30 Received: from drake.dyndns.org\r
31         (static-155-212-141-65.mas.onecommunications.net [155.212.141.65])\r
32         (authenticated bits=0)\r
33         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
34         by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s4HKjtbR014539\r
35         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
36         Sat, 17 May 2014 16:45:58 -0400\r
37 Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
38         (envelope-from <amdragon@mit.edu>)\r
39         id 1WllUR-0002ue-Nd; Sat, 17 May 2014 16:45:55 -0400\r
40 From: Austin Clements <amdragon@MIT.EDU>\r
41 To: notmuch@notmuchmail.org\r
42 Subject: [PATCH] test: Known-broken test for overlapping/adjacent termpos\r
43 Date: Sat, 17 May 2014 16:45:52 -0400\r
44 Message-Id: <1400359552-10928-1-git-send-email-amdragon@mit.edu>\r
45 X-Mailer: git-send-email 1.9.1\r
46 MIME-Version: 1.0\r
47 Content-Type: text/plain; charset=UTF-8\r
48 Content-Transfer-Encoding: 8bit\r
49 X-Brightmail-Tracker:\r
50  H4sIAAAAAAAAA+NgFnrNIsWRmVeSWpSXmKPExsUixG6nottzqjzY4McMMYvrN2cyOzB6PFt1\r
51         izmAMYrLJiU1J7MstUjfLoErY2LLLZaC5YIV86a0sTcwHuDrYuTkkBAwkXh0ZgorhC0mceHe\r
52         erYuRi4OIYHZTBL7rmxjhnA2Mko8fL6ODaRKSOAGk0TfyhiIxFxGiQ8f+8Ha2QQ0JLbtX84I\r
53         YosISEvsvDsbKM7BwSygJvGnSwUkLCzgKXGlt58NJMwioCrx/IMBSJhXwEHixKZDzBBHyEmc\r
54         PDaZFSIuKHFy5hMWiCnqEuvnCYGEmQXkJZq3zmaewCgwC0nVLISqWUiqFjAyr2KUTcmt0s1N\r
55         zMwpTk3WLU5OzMtLLdI11cvNLNFLTSndxAgORxelHYw/DyodYhTgYFTi4eWwLQsWYk0sK67M\r
56         PcQoycGkJMrrt6s8WIgvKT+lMiOxOCO+qDQntfgQowQHs5IIb+ZsoBxvSmJlVWpRPkxKmoNF\r
57         SZz3rbVVsJBAemJJanZqakFqEUxWhoNDSYL3wUmgRsGi1PTUirTMnBKENBMHJ8hwHqDhYDW8\r
58         xQWJucWZ6RD5U4y6HKv+nWljEmLJy89LlRLn3XACqEgApCijNA9uDiyNvGIUB3pLmPclyCge\r
59         YAqCm/QKaAkT0JI3e0tBlpQkIqSkGhjb509x7WrT42VUuyz6jC36WOlxqxmZB6XdjNu/pJbx\r
60         LYyaltZzMrFd5vxinUtr7md79l/cIs+eZ2Rr27HAqWPBUu/lztlLz320aPzoUHx/nt8unlrn\r
61         O+tSkw+p3NqgUf1HcLGJsvFKNvfIoEkzHoTL/xO04p7jEyzGsWviB/+7pXePKa3YEqLEUpyR\r
62         aKjFXFScCADw/Spk/gIAAA==\r
63 X-BeenThere: notmuch@notmuchmail.org\r
64 X-Mailman-Version: 2.1.13\r
65 Precedence: list\r
66 List-Id: "Use and development of the notmuch mail system."\r
67         <notmuch.notmuchmail.org>\r
68 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
69         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
70 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
71 List-Post: <mailto:notmuch@notmuchmail.org>\r
72 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
73 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
74         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
75 X-List-Received-Date: Sat, 17 May 2014 20:46:13 -0000\r
76 \r
77 This adds two known-broken tests and one working test related to the\r
78 term positions assigned to terms from different headers or MIME parts.\r
79 The first test fails because we don't create a termpos gap between\r
80 different headers.  The second test fails because we don't adjust\r
81 termpos at all when indexing multiple parts.\r
82 ---\r
83 \r
84 Thanks to ohm` on IRC for pointing out that we were doing some\r
85 surprising things with term positions in _notmuch_message_gen_terms.\r
86 \r
87 These should be easy to fix for future messages and, given that nobody\r
88 seems to have noticed, it's probably not a big deal for already\r
89 indexed messages.\r
90 \r
91  test/T080-search.sh | 40 ++++++++++++++++++++++++++++++++++++++++\r
92  1 file changed, 40 insertions(+)\r
93 \r
94 diff --git a/test/T080-search.sh b/test/T080-search.sh\r
95 index a7a0b18..df972e1 100755\r
96 --- a/test/T080-search.sh\r
97 +++ b/test/T080-search.sh\r
98 @@ -129,4 +129,44 @@ add_message '[subject]="utf8-message-body-subject"' '[date]="Sat, 01 Jan 2000 12\r
99  output=$(notmuch search "bödý" | notmuch_search_sanitize)\r
100  test_expect_equal "$output" "thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; utf8-message-body-subject (inbox unread)"\r
101  \r
102 +\r
103 +cat <<EOF > ${MAIL_DIR}/termpos\r
104 +From: Source <source@example.com>\r
105 +To: Dest <dest@example.com>\r
106 +Subject: part overlap test\r
107 +Date: Sat, 01 January 2000 00:00:00 +0000\r
108 +Message-ID: <termpos>\r
109 +MIME-Version: 1.0\r
110 +Content-Type: multipart/mixed; boundary="==-=="\r
111 +\r
112 +--==-==\r
113 +Content-Type: text/plain\r
114 +\r
115 +a b c\r
116 +\r
117 +--==-==\r
118 +Content-Type: text/plain\r
119 +\r
120 +x y z\r
121 +\r
122 +--==-==--\r
123 +EOF\r
124 +notmuch new > /dev/null\r
125 +\r
126 +test_begin_subtest "headers do not have adjacent term positions"\r
127 +test_subtest_known_broken\r
128 +# Test for bug where "To" is indexed immediately after "From" without\r
129 +# a termpos gap\r
130 +output=$(notmuch search id:termpos and "com dest")\r
131 +test_expect_equal "$output" ""\r
132 +\r
133 +test_begin_subtest "parts have non-overlapping term positions"\r
134 +test_subtest_known_broken\r
135 +output=$(notmuch search id:termpos and '"a y c"')\r
136 +test_expect_equal "$output" ""\r
137 +\r
138 +test_begin_subtest "parts do not have adjacent term positions"\r
139 +output=$(notmuch search id:termpos and '"c x"')\r
140 +test_expect_equal "$output" ""\r
141 +\r
142  test_done\r
143 -- \r
144 1.9.1\r
145 \r