[PATCH 4/5] test: Known-broken test for overlapping/adjacent termpos
authorAustin Clements <amdragon@MIT.EDU>
Mon, 16 Jun 2014 02:40:33 +0000 (22:40 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:03:14 +0000 (10:03 -0800)
50/ebbbfd65ebbc96ee94fd59140526e390f359ac [new file with mode: 0644]

diff --git a/50/ebbbfd65ebbc96ee94fd59140526e390f359ac b/50/ebbbfd65ebbc96ee94fd59140526e390f359ac
new file mode 100644 (file)
index 0000000..a524d88
--- /dev/null
@@ -0,0 +1,141 @@
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 2E806431FCB\r
+       for <notmuch@notmuchmail.org>; Sun, 15 Jun 2014 19:41:32 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id KTHQh2tcS4QN for <notmuch@notmuchmail.org>;\r
+       Sun, 15 Jun 2014 19:41:28 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu\r
+       [18.9.25.13])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id D2A80431FD7\r
+       for <notmuch@notmuchmail.org>; Sun, 15 Jun 2014 19:41:07 -0700 (PDT)\r
+X-AuditID: 1209190d-f798f6d000000c3b-e3-539e5943acd2\r
+Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])\r
+       (using TLS with cipher AES256-SHA (256/256 bits))\r
+       (Client did not present a certificate)\r
+       by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id A9.03.03131.3495E935; Sun, 15 Jun 2014 22:41:07 -0400 (EDT)\r
+Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11])\r
+       by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id s5G2euA8005172; \r
+       Sun, 15 Jun 2014 22:40:56 -0400\r
+Received: from drake.dyndns.org\r
+       (216-15-114-40.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [216.15.114.40]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s5G2en8D003391\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sun, 15 Jun 2014 22:40:55 -0400\r
+Received: from amthrax by drake.dyndns.org with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1WwMqn-0004HH-Cj; Sun, 15 Jun 2014 22:40:49 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 4/5] test: Known-broken test for overlapping/adjacent termpos\r
+Date: Sun, 15 Jun 2014 22:40:33 -0400\r
+Message-Id: <1402886434-16169-5-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 2.0.0.rc2\r
+In-Reply-To: <1402886434-16169-1-git-send-email-amdragon@mit.edu>\r
+References: <1402886434-16169-1-git-send-email-amdragon@mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: 8bit\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IR4hRV1nWOnBdsMOcPq8X1mzOZHRg9nq26\r
+       xRzAGMVlk5Kak1mWWqRvl8CV0fXCqaCTv2Lrxs8sDYx3eboYOTkkBEwk2jdeZYewxSQu3FvP\r
+       1sXIxSEkMJtJYsGBmawQzkZGiU1nP7KCVAkJ3GGSmLuiEiIxl1Hi8IovbCAJNgENiW37lzOC\r
+       2CIC0hI7784GauDgYBZQk/jTpQISFhbwlbh3ZS8TiM0ioCpxau0bdpASXgEHie0dsRBHKAGV\r
+       zAGbwingKDFx9Sl2iLUOEv/O3ABr5RUQlDg58wkLxHR1ifXzhEDCzALyEs1bZzNPYBSahaRq\r
+       FkLVLCRVCxiZVzHKpuRW6eYmZuYUpybrFicn5uWlFuka6eVmluilppRuYgQHryTvDsZ3B5UO\r
+       MQpwMCrx8E5wnBcsxJpYVlyZe4hRkoNJSZSXGSTEl5SfUpmRWJwRX1Sak1p8iFGCg1lJhNfe\r
+       ByjHm5JYWZValA+TkuZgURLnfWttFSwkkJ5YkpqdmlqQWgSTleHgUJLgNYsAahQsSk1PrUjL\r
+       zClBSDNxcIIM5wEabglSw1tckJhbnJkOkT/FqMux6t+ZNiYhlrz8vFQpcV5OkCIBkKKM0jy4\r
+       ObCk84pRHOgtYd5ckCoeYMKCm/QKaAkT0JKbi2eBLClJREhJNTBOZn9U6bfpvdWF2UEzzwad\r
+       uh9YzX89+TsD77SSjofLnrwVn51U+3W+9Ol5BXyR8d9Fb3rFrtqwjm3vxs1Vm8+W2FsJH7Be\r
+       e+O8u3i15V4Z5XUi7bv9NLbOvs3sOTso2HX3iVDW9eq9Cxx12H3rNvm9/vyEddcvDo43/zcz\r
+       3FqhwB3fmjVfcLG7EktxRqKhFnNRcSIALKm8PxUDAAA=\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 16 Jun 2014 02:41:32 -0000\r
+\r
+This adds two known-broken tests and one working test related to the\r
+term positions assigned to terms from different headers or MIME parts.\r
+The first test fails because we don't create a termpos gap between\r
+different headers.  The second test fails because we don't adjust\r
+termpos at all when indexing multiple parts.\r
+---\r
+ test/T080-search.sh | 40 ++++++++++++++++++++++++++++++++++++++++\r
+ 1 file changed, 40 insertions(+)\r
+\r
+diff --git a/test/T080-search.sh b/test/T080-search.sh\r
+index b63bf02..3f6b565 100755\r
+--- a/test/T080-search.sh\r
++++ b/test/T080-search.sh\r
+@@ -145,4 +145,44 @@ add_message '[subject]="utf8-message-body-subject"' '[date]="Sat, 01 Jan 2000 12\r
+ output=$(notmuch search "bödý" | notmuch_search_sanitize)\r
+ test_expect_equal "$output" "thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; utf8-message-body-subject (inbox unread)"\r
\r
++\r
++cat <<EOF > ${MAIL_DIR}/termpos\r
++From: Source <source@example.com>\r
++To: Dest <dest@example.com>\r
++Subject: part overlap test\r
++Date: Sat, 01 January 2000 00:00:00 +0000\r
++Message-ID: <termpos>\r
++MIME-Version: 1.0\r
++Content-Type: multipart/mixed; boundary="==-=="\r
++\r
++--==-==\r
++Content-Type: text/plain\r
++\r
++a b c\r
++\r
++--==-==\r
++Content-Type: text/plain\r
++\r
++x y z\r
++\r
++--==-==--\r
++EOF\r
++notmuch new > /dev/null\r
++\r
++test_begin_subtest "headers do not have adjacent term positions"\r
++test_subtest_known_broken\r
++# Regression test for a bug where term positions for non-prefixed\r
++# terms weren't updated\r
++output=$(notmuch search id:termpos and '"com dest"')\r
++test_expect_equal "$output" ""\r
++\r
++test_begin_subtest "parts have non-overlapping term positions"\r
++test_subtest_known_broken\r
++output=$(notmuch search id:termpos and '"a y c"')\r
++test_expect_equal "$output" ""\r
++\r
++test_begin_subtest "parts do not have adjacent term positions"\r
++output=$(notmuch search id:termpos and '"c x"')\r
++test_expect_equal "$output" ""\r
++\r
+ test_done\r
+-- \r
+2.0.0.rc2\r
+\r