aboutsummaryrefslogtreecommitdiffhomepage
path: root/test
diff options
context:
space:
mode:
authorGravatar Austin Clements <amdragon@MIT.EDU>2014-06-15 22:40:33 -0400
committerGravatar David Bremner <david@tethera.net>2014-06-18 17:56:52 -0300
commitc1805576a0f57540bdf8643f1b7989fad793b929 (patch)
tree3d0c531318362ef043ce42c1d179ed8ccc8956a6 /test
parent44327ca86d8e3563490801f57a2d1ca455d9588e (diff)
test: Known-broken test for overlapping/adjacent termpos
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.
Diffstat (limited to 'test')
-rwxr-xr-xtest/T080-search.sh40
1 files changed, 40 insertions, 0 deletions
diff --git a/test/T080-search.sh b/test/T080-search.sh
index b63bf023..3f6b565f 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 <<EOF > ${MAIL_DIR}/termpos
+From: Source <source@example.com>
+To: Dest <dest@example.com>
+Subject: part overlap test
+Date: Sat, 01 January 2000 00:00:00 +0000
+Message-ID: <termpos>
+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