[PATCH] test/search: add check for slightly trick search

2011-02-07 Thread Felipe Contreras
On Sun, Feb 6, 2011 at 3:21 PM, Felipe Contreras
 wrote:
> It's not really tricky, there are many addresses with a '-' in them. I
> personally really want to differentiate between foo, foo-testing, and
> foo-patches.
>
> This fails, but it shouldn't:

As discussed in IRC, perhaps the query should be 'search-by-from@',
but that would require notmuch to distinguish @ as something special.
Perhaps s/@/-at-/.

Cheers.

-- 
Felipe Contreras


[PATCH] test/search: add check for slightly trick search

2011-02-06 Thread Felipe Contreras
It's not really tricky, there are many addresses with a '-' in them. I
personally really want to differentiate between foo, foo-testing, and
foo-patches.

This fails, but it shouldn't:

 FAIL   Search by from (tricky):
--- search.17.expected  2011-02-06 13:16:31.871509560 +
+++ search.17.output2011-02-06 13:16:31.871509560 +
@@ -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; search by from 
(tricky trick) (inbox unread)
 thread:XXX   2000-01-01 [1/1] search-by-from; search by from (tricky) 
(inbox unread)

Signed-off-by: Felipe Contreras 
---
 test/search |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/test/search b/test/search
index b180c7f..ad5bbaa 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 -"' '[from]=search-by-from-trick'
+add_message '[subject]="search by from (tricky)"' '[date]="Sat, 01 Jan 2000 
12:00:00 -"' '[from]=search-by-from'
+output=$(notmuch search from:'search-by-from' | notmuch_search_sanitize)
+test_expect_equal "$output" "thread:XXX   2000-01-01 [1/1] search-by-from; 
search by from (tricky) (inbox unread)"
+
 test_done
-- 
1.7.4.1.g4f7e4.dirty



Re: [PATCH] test/search: add check for slightly trick search

2011-02-06 Thread Felipe Contreras
On Sun, Feb 6, 2011 at 3:21 PM, Felipe Contreras
 wrote:
> It's not really tricky, there are many addresses with a '-' in them. I
> personally really want to differentiate between foo, foo-testing, and
> foo-patches.
>
> This fails, but it shouldn't:

As discussed in IRC, perhaps the query should be 'search-by-from@',
but that would require notmuch to distinguish @ as something special.
Perhaps s/@/-at-/.

Cheers.

-- 
Felipe Contreras
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[PATCH] test/search: add check for slightly trick search

2011-02-06 Thread Felipe Contreras
It's not really tricky, there are many addresses with a '-' in them. I
personally really want to differentiate between foo, foo-testing, and
foo-patches.

This fails, but it shouldn't:

 FAIL   Search by from (tricky):
--- search.17.expected  2011-02-06 13:16:31.871509560 +
+++ search.17.output2011-02-06 13:16:31.871509560 +
@@ -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; search by from 
(tricky trick) (inbox unread)
 thread:XXX   2000-01-01 [1/1] search-by-from; search by from (tricky) 
(inbox unread)

Signed-off-by: Felipe Contreras 
---
 test/search |6 ++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/test/search b/test/search
index b180c7f..ad5bbaa 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 -"' '[from]=search-by-from-trick'
+add_message '[subject]="search by from (tricky)"' '[date]="Sat, 01 Jan 2000 
12:00:00 -"' '[from]=search-by-from'
+output=$(notmuch search from:'search-by-from' | notmuch_search_sanitize)
+test_expect_equal "$output" "thread:XXX   2000-01-01 [1/1] search-by-from; 
search by from (tricky) (inbox unread)"
+
 test_done
-- 
1.7.4.1.g4f7e4.dirty

___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch