1 Return-Path: <amdragon@mit.edu>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 0415F431FD0
\r
6 for <notmuch@notmuchmail.org>; Mon, 24 Jan 2011 09:15:07 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id QJ4-G0Q3Evg3 for <notmuch@notmuchmail.org>;
\r
16 Mon, 24 Jan 2011 09:15:06 -0800 (PST)
\r
17 Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU
\r
19 by olra.theworths.org (Postfix) with ESMTP id 2D337431FB6
\r
20 for <notmuch@notmuchmail.org>; Mon, 24 Jan 2011 09:15:06 -0800 (PST)
\r
21 X-AuditID: 1209190d-b7cacae000000a14-3e-4d3db3992f7a
\r
22 Received: from mailhub-auth-1.mit.edu ( [18.9.21.35])
\r
23 by dmz-mailsec-scanner-2.mit.edu (Symantec Brightmail Gateway) with
\r
24 SMTP id 2A.5E.02580.993BD3D4; Mon, 24 Jan 2011 12:15:05 -0500 (EST)
\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])
\r
26 by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id p0OHF4r4021383
\r
27 for <notmuch@notmuchmail.org>; Mon, 24 Jan 2011 12:15:05 -0500
\r
28 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])
\r
29 (authenticated bits=0)
\r
30 (User authenticated as amdragon@ATHENA.MIT.EDU)
\r
31 by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p0OHF3oP016432
\r
32 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT)
\r
33 for <notmuch@notmuchmail.org>; Mon, 24 Jan 2011 12:15:04 -0500 (EST)
\r
34 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.72)
\r
35 (envelope-from <amdragon@mit.edu>) id 1PhQ0N-0000HA-Ew
\r
36 for notmuch@notmuchmail.org; Mon, 24 Jan 2011 12:15:03 -0500
\r
37 Date: Mon, 24 Jan 2011 12:15:03 -0500
\r
38 From: Austin Clements <amdragon@MIT.EDU>
\r
39 To: notmuch@notmuchmail.org
\r
40 Subject: [PATCH 5.5/8] test: Wildcard tag search and untagged search.
\r
41 Message-ID: <20110124171503.GP13226@mit.edu>
\r
42 References: <1295165458-9573-1-git-send-email-amdragon@mit.edu>
\r
43 <1295165458-9573-6-git-send-email-amdragon@mit.edu>
\r
45 Content-Type: text/plain; charset=iso-8859-1
\r
46 Content-Disposition: inline
\r
47 Content-Transfer-Encoding: 8bit
\r
48 In-Reply-To: <1295165458-9573-6-git-send-email-amdragon@mit.edu>
\r
49 User-Agent: Mutt/1.5.20 (2009-06-14)
\r
50 X-Brightmail-Tracker: AAAAARcyn1c=
\r
51 X-BeenThere: notmuch@notmuchmail.org
\r
52 X-Mailman-Version: 2.1.13
\r
54 List-Id: "Use and development of the notmuch mail system."
\r
55 <notmuch.notmuchmail.org>
\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
59 List-Post: <mailto:notmuch@notmuchmail.org>
\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
62 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
63 X-List-Received-Date: Mon, 24 Jan 2011 17:15:07 -0000
\r
66 test/qparser-test.cc | 6 +++---
\r
67 test/qparser.expected-output/wildcards | 13 +++++++++++++
\r
68 test/search | 12 ++++++++++++
\r
69 3 files changed, 28 insertions(+), 3 deletions(-)
\r
71 diff --git a/test/qparser-test.cc b/test/qparser-test.cc
\r
72 index ae6c8b9..7b145cc 100644
\r
73 --- a/test/qparser-test.cc
\r
74 +++ b/test/qparser-test.cc
\r
75 @@ -100,9 +100,9 @@ static _notmuch_qparser_t *
\r
76 create_qparser (void *ctx)
\r
78 _notmuch_qparser_t *qparser = _notmuch_qparser_create (ctx, notmuch);
\r
79 - _notmuch_qparser_add_db_prefix (qparser, "prob", "P", FALSE);
\r
80 - _notmuch_qparser_add_db_prefix (qparser, "lit", "L", TRUE);
\r
81 - _notmuch_qparser_add_db_prefix (qparser, "tag", "K", TRUE);
\r
82 + _notmuch_qparser_add_db_prefix (qparser, "prob", "P", FALSE, FALSE);
\r
83 + _notmuch_qparser_add_db_prefix (qparser, "lit", "L", TRUE, FALSE);
\r
84 + _notmuch_qparser_add_db_prefix (qparser, "tag", "K", TRUE, TRUE);
\r
88 diff --git a/test/qparser.expected-output/wildcards b/test/qparser.expected-output/wildcards
\r
89 index 6f62829..0558732 100644
\r
90 --- a/test/qparser.expected-output/wildcards
\r
91 +++ b/test/qparser.expected-output/wildcards
\r
92 @@ -18,3 +18,16 @@ nosuchterm* AND x
\r
93 [parse] (AND "nosuchterm"* "x")
\r
94 [gen] (nosuchterm AND x:(pos=1))
\r
97 +# Incompatible; Xapian doesn't accept wildcards in boolean prefixes
\r
99 +[lex] PREFIX/tag "*"
\r
100 +[parse] (FILTER (PREFIX/tag '*'))
\r
101 +[gen] 0 * (Kinbox:(pos=1) SYNONYM Kunread:(pos=1))
\r
105 +[lex] PREFIX/tag "i*"
\r
106 +[parse] (FILTER (PREFIX/tag 'i*'))
\r
107 +[gen] 0 * Kinbox:(pos=1)
\r
109 diff --git a/test/search b/test/search
\r
110 index b180c7f..7d1dedb 100755
\r
113 @@ -113,6 +113,18 @@ thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inbox unr
\r
114 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subject search test (phrase) (inbox unread)
\r
115 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; this phrase should not match the subject search test (inbox unread)"
\r
117 +test_begin_subtest 'Search by wildcard tag ("at*")'
\r
118 +output=$(notmuch search 'tag:at*' | notmuch_search_sanitize)
\r
119 +test_expect_equal "$output" "thread:XXX 2009-11-18 [2/2] Lars Kellogg-Stedman; [notmuch] \"notmuch help\" outputs to stderr? (attachment inbox unread)
\r
120 +thread:XXX 2009-11-18 [1/2] Alex Botero-Lowry| Carl Worth; [notmuch] [PATCH] Error out if no query is supplied to search instead of going into an infinite loop (attachment inbox unread)
\r
121 +thread:XXX 2009-11-17 [1/2] Alex Botero-Lowry| Carl Worth; [notmuch] preliminary FreeBSD support (attachment inbox unread)"
\r
123 +test_begin_subtest 'Search for untagged messages'
\r
124 +add_message '[subject]="untagged message"'
\r
125 +notmuch tag -inbox -unread id:$gen_msg_id
\r
126 +output=$(notmuch search 'NOT tag:*' | notmuch_search_sanitize)
\r
127 +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; untagged message ()"
\r
129 test_begin_subtest "Search body (utf-8):"
\r
130 add_message '[subject]="utf8-message-body-subject"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="message body utf8: bödý"'
\r
131 output=$(notmuch search "bödý" | notmuch_search_sanitize)
\r