From: David Bremner <david@tethera.net>
To: notmuch@notmuchmail.org
Subject: [PATCH 1/2] test: add known broken test for null from: and subject: query
Date: Fri, 24 Mar 2017 19:52:50 -0300 [thread overview]
Message-ID: <20170324225251.21107-2-david@tethera.net> (raw)
In-Reply-To: <20170324225251.21107-1-david@tethera.net>
These queries currently fail with field processors enabled because the
code expects a non-empty string.
---
test/T650-regexp-query.sh | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
diff --git a/test/T650-regexp-query.sh b/test/T650-regexp-query.sh
index 61739e87..f2ae1387 100755
--- a/test/T650-regexp-query.sh
+++ b/test/T650-regexp-query.sh
@@ -11,6 +11,26 @@ fi
notmuch search --output=messages from:cworth > cworth.msg-ids
+# these headers will generate no document terms
+add_message '[from]="-" [subject]="empty from"'
+add_message '[subject]="-"'
+
+test_begin_subtest "null from: search"
+test_subtest_known_broken
+notmuch search 'from:""' | notmuch_search_sanitize > OUTPUT
+cat <<EOF > EXPECTED
+thread:XXX 2001-01-05 [1/1] -; empty from (inbox unread)
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
+test_begin_subtest "null subject: search"
+test_subtest_known_broken
+notmuch search 'subject:""' | notmuch_search_sanitize > OUTPUT
+cat <<EOF > EXPECTED
+thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; - (inbox unread)
+EOF
+test_expect_equal_file EXPECTED OUTPUT
+
test_begin_subtest "xapian wildcard search for from:"
notmuch search --output=messages 'from:cwo*' > OUTPUT
test_expect_equal_file cworth.msg-ids OUTPUT
--
2.11.0
next prev parent reply other threads:[~2017-03-24 22:53 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-24 22:52 revised foo:"" handling David Bremner
2017-03-24 22:52 ` David Bremner [this message]
2017-03-24 22:52 ` [PATCH 2/2] lib: handle empty string in regexp field processors David Bremner
2017-03-25 11:30 ` David Bremner
2017-03-29 20:07 ` revised foo:"" handling Tomi Ollila
2017-03-30 0:27 ` David Bremner
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170324225251.21107-2-david@tethera.net \
--to=david@tethera.net \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).