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