From: Felipe Contreras <felipe.contreras@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH v3] test/search: add check for slightly tricky search
Date: Thu, 5 May 2011 00:55:58 +0300 [thread overview]
Message-ID: <1304546158-15998-1-git-send-email-felipe.contreras@gmail.com> (raw)
In-Reply-To: <20110504212636.GP29861@mit.edu>
It's not really tricky, there are many addresses with a '-' in them. I
personally really want to differentiate between foo@bar.com,
foo-testing@bar.com, and foo-patches@bar.com.
This fails, but it shouldn't:
FAIL Search by from (tricky):
--- search.17.expected 2011-05-04 21:52:52.913218077 +0000
+++ search.17.output 2011-05-04 21:52:52.913218077 +0000
@@ -1 +1,3 @@
+thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (inbox unread)
+thread:XXX 2000-01-01 [1/1] search-by-from-trick@foo.com; search by from (tricky trick) (inbox unread)
thread:XXX 2000-01-01 [1/1] search-by-from@foo.com; search by from (tricky) (inbox unread)
One possibility to make this work is to translate @ to -at- in the
database, so search-by-from@foo.com becomes search-by-from-trick-at-foo.com,
therefore searching for search-by-from-at- would not be confused.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
test/search | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/test/search b/test/search
index b180c7f..c6223f4 100755
--- a/test/search
+++ b/test/search
@@ -123,4 +123,10 @@ echo -n > expected &&
notmuch search "no-message-matches-this" > actual &&
test_cmp expected actual'
+test_begin_subtest "Search by from (tricky):"
+add_message '[subject]="search by from (tricky trick)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[from]=search-by-from-trick@foo.com'
+add_message '[subject]="search by from (tricky)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[from]=search-by-from@foo.com'
+output=$(notmuch search from:"search-by-from@" | notmuch_search_sanitize)
+test_expect_equal "$output" "thread:XXX 2000-01-01 [1/1] search-by-from@foo.com; search by from (tricky) (inbox unread)"
+
test_done
--
1.7.5
prev parent reply other threads:[~2011-05-04 21:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-04 20:26 [PATCH v2] test/search: add check for slightly trick search Felipe Contreras
2011-05-04 20:46 ` Austin Clements
2011-05-04 20:54 ` Felipe Contreras
2011-05-04 21:26 ` Austin Clements
2011-05-04 21:55 ` Felipe Contreras [this message]
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=1304546158-15998-1-git-send-email-felipe.contreras@gmail.com \
--to=felipe.contreras@gmail.com \
--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).