Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 0415F431FD0 for ; Mon, 24 Jan 2011 09:15:07 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id QJ4-G0Q3Evg3 for ; Mon, 24 Jan 2011 09:15:06 -0800 (PST) Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU [18.9.25.13]) by olra.theworths.org (Postfix) with ESMTP id 2D337431FB6 for ; Mon, 24 Jan 2011 09:15:06 -0800 (PST) X-AuditID: 1209190d-b7cacae000000a14-3e-4d3db3992f7a Received: from mailhub-auth-1.mit.edu ( [18.9.21.35]) by dmz-mailsec-scanner-2.mit.edu (Symantec Brightmail Gateway) with SMTP id 2A.5E.02580.993BD3D4; Mon, 24 Jan 2011 12:15:05 -0500 (EST) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-1.mit.edu (8.13.8/8.9.2) with ESMTP id p0OHF4r4021383 for ; Mon, 24 Jan 2011 12:15:05 -0500 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id p0OHF3oP016432 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 24 Jan 2011 12:15:04 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.72) (envelope-from ) id 1PhQ0N-0000HA-Ew for notmuch@notmuchmail.org; Mon, 24 Jan 2011 12:15:03 -0500 Date: Mon, 24 Jan 2011 12:15:03 -0500 From: Austin Clements To: notmuch@notmuchmail.org Subject: [PATCH 5.5/8] test: Wildcard tag search and untagged search. Message-ID: <20110124171503.GP13226@mit.edu> References: <1295165458-9573-1-git-send-email-amdragon@mit.edu> <1295165458-9573-6-git-send-email-amdragon@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1295165458-9573-6-git-send-email-amdragon@mit.edu> User-Agent: Mutt/1.5.20 (2009-06-14) X-Brightmail-Tracker: AAAAARcyn1c= X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 17:15:07 -0000 --- test/qparser-test.cc | 6 +++--- test/qparser.expected-output/wildcards | 13 +++++++++++++ test/search | 12 ++++++++++++ 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/test/qparser-test.cc b/test/qparser-test.cc index ae6c8b9..7b145cc 100644 --- a/test/qparser-test.cc +++ b/test/qparser-test.cc @@ -100,9 +100,9 @@ static _notmuch_qparser_t * create_qparser (void *ctx) { _notmuch_qparser_t *qparser = _notmuch_qparser_create (ctx, notmuch); - _notmuch_qparser_add_db_prefix (qparser, "prob", "P", FALSE); - _notmuch_qparser_add_db_prefix (qparser, "lit", "L", TRUE); - _notmuch_qparser_add_db_prefix (qparser, "tag", "K", TRUE); + _notmuch_qparser_add_db_prefix (qparser, "prob", "P", FALSE, FALSE); + _notmuch_qparser_add_db_prefix (qparser, "lit", "L", TRUE, FALSE); + _notmuch_qparser_add_db_prefix (qparser, "tag", "K", TRUE, TRUE); return qparser; } diff --git a/test/qparser.expected-output/wildcards b/test/qparser.expected-output/wildcards index 6f62829..0558732 100644 --- a/test/qparser.expected-output/wildcards +++ b/test/qparser.expected-output/wildcards @@ -18,3 +18,16 @@ nosuchterm* AND x [parse] (AND "nosuchterm"* "x") [gen] (nosuchterm AND x:(pos=1)) [xapian] + +# Incompatible; Xapian doesn't accept wildcards in boolean prefixes +tag:* +[lex] PREFIX/tag "*" +[parse] (FILTER (PREFIX/tag '*')) +[gen] 0 * (Kinbox:(pos=1) SYNONYM Kunread:(pos=1)) +[xapian] 0 * K* + +tag:i* +[lex] PREFIX/tag "i*" +[parse] (FILTER (PREFIX/tag 'i*')) +[gen] 0 * Kinbox:(pos=1) +[xapian] 0 * Ki* diff --git a/test/search b/test/search index b180c7f..7d1dedb 100755 --- a/test/search +++ b/test/search @@ -113,6 +113,18 @@ thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inbox unr thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subject search test (phrase) (inbox unread) thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; this phrase should not match the subject search test (inbox unread)" +test_begin_subtest 'Search by wildcard tag ("at*")' +output=$(notmuch search 'tag:at*' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2009-11-18 [2/2] Lars Kellogg-Stedman; [notmuch] \"notmuch help\" outputs to stderr? (attachment inbox unread) +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) +thread:XXX 2009-11-17 [1/2] Alex Botero-Lowry| Carl Worth; [notmuch] preliminary FreeBSD support (attachment inbox unread)" + +test_begin_subtest 'Search for untagged messages' +add_message '[subject]="untagged message"' +notmuch tag -inbox -unread id:$gen_msg_id +output=$(notmuch search 'NOT tag:*' | notmuch_search_sanitize) +test_expect_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; untagged message ()" + test_begin_subtest "Search body (utf-8):" add_message '[subject]="utf8-message-body-subject"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="message body utf8: bödı"' output=$(notmuch search "bödı" | notmuch_search_sanitize) -- 1.7.2.3