From 157dfd5649f043cf4e55591fb6c5fcfddbb5c3a5 Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Sun, 18 May 2014 16:45:52 +2000 Subject: [PATCH] [PATCH] test: Known-broken test for overlapping/adjacent termpos --- 57/0046d9dbae6d4ca6cc4be88ea8e32ca62bbcdf | 145 ++++++++++++++++++++++ 1 file changed, 145 insertions(+) create mode 100644 57/0046d9dbae6d4ca6cc4be88ea8e32ca62bbcdf diff --git a/57/0046d9dbae6d4ca6cc4be88ea8e32ca62bbcdf b/57/0046d9dbae6d4ca6cc4be88ea8e32ca62bbcdf new file mode 100644 index 000000000..107dad037 --- /dev/null +++ b/57/0046d9dbae6d4ca6cc4be88ea8e32ca62bbcdf @@ -0,0 +1,145 @@ +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 08585431FBF + for ; Sat, 17 May 2014 13:46:13 -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 dkUZwSfrVFei for ; + Sat, 17 May 2014 13:46:06 -0700 (PDT) +Received: from dmz-mailsec-scanner-5.mit.edu (dmz-mailsec-scanner-5.mit.edu + [18.7.68.34]) + by olra.theworths.org (Postfix) with ESMTP id 61A7D431FBC + for ; Sat, 17 May 2014 13:46:06 -0700 (PDT) +X-AuditID: 12074422-f79376d000000c58-88-5377ca8cb1dd +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + (using TLS with cipher AES256-SHA (256/256 bits)) + (Client did not present a certificate) + by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP + id E9.9D.03160.C8AC7735; Sat, 17 May 2014 16:46:04 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id s4HKjww4017387; + Sat, 17 May 2014 16:45:59 -0400 +Received: from drake.dyndns.org + (static-155-212-141-65.mas.onecommunications.net [155.212.141.65]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id s4HKjtbR014539 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Sat, 17 May 2014 16:45:58 -0400 +Received: from amthrax by drake.dyndns.org with local (Exim 4.77) + (envelope-from ) + id 1WllUR-0002ue-Nd; Sat, 17 May 2014 16:45:55 -0400 +From: Austin Clements +To: notmuch@notmuchmail.org +Subject: [PATCH] test: Known-broken test for overlapping/adjacent termpos +Date: Sat, 17 May 2014 16:45:52 -0400 +Message-Id: <1400359552-10928-1-git-send-email-amdragon@mit.edu> +X-Mailer: git-send-email 1.9.1 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFnrNIsWRmVeSWpSXmKPExsUixG6nottzqjzY4McMMYvrN2cyOzB6PFt1 + izmAMYrLJiU1J7MstUjfLoErY2LLLZaC5YIV86a0sTcwHuDrYuTkkBAwkXh0ZgorhC0mceHe + erYuRi4OIYHZTBL7rmxjhnA2Mko8fL6ODaRKSOAGk0TfyhiIxFxGiQ8f+8Ha2QQ0JLbtX84I + YosISEvsvDsbKM7BwSygJvGnSwUkLCzgKXGlt58NJMwioCrx/IMBSJhXwEHixKZDzBBHyEmc + PDaZFSIuKHFy5hMWiCnqEuvnCYGEmQXkJZq3zmaewCgwC0nVLISqWUiqFjAyr2KUTcmt0s1N + zMwpTk3WLU5OzMtLLdI11cvNLNFLTSndxAgORxelHYw/DyodYhTgYFTi4eWwLQsWYk0sK67M + PcQoycGkJMrrt6s8WIgvKT+lMiOxOCO+qDQntfgQowQHs5IIb+ZsoBxvSmJlVWpRPkxKmoNF + SZz3rbVVsJBAemJJanZqakFqEUxWhoNDSYL3wUmgRsGi1PTUirTMnBKENBMHJ8hwHqDhYDW8 + xQWJucWZ6RD5U4y6HKv+nWljEmLJy89LlRLn3XACqEgApCijNA9uDiyNvGIUB3pLmPclyCge + YAqCm/QKaAkT0JI3e0tBlpQkIqSkGhjb509x7WrT42VUuyz6jC36WOlxqxmZB6XdjNu/pJbx + LYyaltZzMrFd5vxinUtr7md79l/cIs+eZ2Rr27HAqWPBUu/lztlLz320aPzoUHx/nt8unlrn + O+tSkw+p3NqgUf1HcLGJsvFKNvfIoEkzHoTL/xO04p7jEyzGsWviB/+7pXePKa3YEqLEUpyR + aKjFXFScCADw/Spk/gIAAA== +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: Sat, 17 May 2014 20:46:13 -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. +--- + +Thanks to ohm` on IRC for pointing out that we were doing some +surprising things with term positions in _notmuch_message_gen_terms. + +These should be easy to fix for future messages and, given that nobody +seems to have noticed, it's probably not a big deal for already +indexed messages. + + test/T080-search.sh | 40 ++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 40 insertions(+) + +diff --git a/test/T080-search.sh b/test/T080-search.sh +index a7a0b18..df972e1 100755 +--- a/test/T080-search.sh ++++ b/test/T080-search.sh +@@ -129,4 +129,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 ++# Test for bug where "To" is indexed immediately after "From" without ++# a termpos gap ++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 +-- +1.9.1 + -- 2.26.2