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 275C0431FD0 for ; Sun, 23 Jan 2011 14:02:47 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.698 X-Spam-Level: X-Spam-Status: No, score=-0.698 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7] 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 6chJZHClJqg7 for ; Sun, 23 Jan 2011 14:02:46 -0800 (PST) Received: from mail-qw0-f53.google.com (mail-qw0-f53.google.com [209.85.216.53]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 43369431FB6 for ; Sun, 23 Jan 2011 14:02:46 -0800 (PST) Received: by qwe5 with SMTP id 5so3689310qwe.26 for ; Sun, 23 Jan 2011 14:02:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=UR8QYuUG8D+qs+EJ/3uE8gkD2d5qLt/AAXqTUmL3uRI=; b=kDtyzFXLkz7AvJ1fz+VCeL8vgkCiUV1xItP1wiEAmZ+pSYeLRiQtsvBs+DBts/CMtv FlrSk+IK/b07SuBFE9r23smQsloCdQYIrsee1543J69j9h3Hfy5OAV/xQoBy322zrP2T OEuyoUxTFzD/6OsSEQCRCxFqYagSDEKITjH68= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=FjH8y1imG4XZeCtYNWzv3y/3lotthYVYqXN03yIPHi8Cah8Fnftiyy04XP9UOMMZSN pxY8FpzzHCkK6+GaqBD9nB6BvDP7qidt90U2W4qpI0oLotSB0GTc306Jevim+ORszf8o j0R1OIL9VTkHvM3b/lWeGXEFBmf60zoWqYXMc= MIME-Version: 1.0 Received: by 10.229.217.133 with SMTP id hm5mr3137718qcb.40.1295820163376; Sun, 23 Jan 2011 14:02:43 -0800 (PST) Sender: amdragon@gmail.com Received: by 10.229.97.143 with HTTP; Sun, 23 Jan 2011 14:02:43 -0800 (PST) In-Reply-To: <87pqrosx6e.fsf@steelpick.2x.cz> References: <1295165458-9573-1-git-send-email-amdragon@mit.edu> <1295165458-9573-4-git-send-email-amdragon@mit.edu> <20110121064003.GK13226@mit.edu> <87pqrosx6e.fsf@steelpick.2x.cz> Date: Sun, 23 Jan 2011 17:02:43 -0500 X-Google-Sender-Auth: JyOYyyFSPYKP2UhXVPQ_LysGUEY Message-ID: Subject: Re: [PATCH 3.5/8] Query parser tests for wildcard queries. From: Austin Clements To: Michal Sojka Content-Type: multipart/alternative; boundary=0016361e81a287e719049a8aa496 Cc: notmuch@notmuchmail.org 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: Sun, 23 Jan 2011 22:02:47 -0000 --0016361e81a287e719049a8aa496 Content-Type: text/plain; charset=ISO-8859-1 Oops, yes. I'm not sure why you had to initialize qparser_desc (are you sure it doesn't compile if you omit that?), but a change in the later patch 5/8 requires the extra argument to _notmuch_qparser_add_db_prefix. I've got another patch with tests for patch 5/8 that adds and tests the argument that I'll send out shortly (along with tests for the remaining patches). Glad to see you're taking advantage of the query parser! On Sat, Jan 22, 2011 at 11:47 AM, Michal Sojka wrote: > On Fri, 21 Jan 2011, Austin Clements wrote: > > Since wildcard queries require a database, qparser-test can now open a > > database. > > Hi Austin, > > I had to apply the following changes in order to be able to compile the > tests (make test). > > I'm going to test the parser in my daily use, but so far it looks really > nice. I especially enjoy the before and after searches. Thanks. > > -Michal > > diff --git a/test/qparser-test.cc b/test/qparser-test.cc > index 18318aa..5be6220 100644 > --- a/test/qparser-test.cc > +++ b/test/qparser-test.cc > @@ -61,7 +61,7 @@ test_one (void *ctx, const char *query_str) > void *local = talloc_new (ctx); > Xapian::Query q; > _notmuch_token_t *toks, *root; > - char *error, *qparser_desc, *xqparser_desc; > + char *error, *qparser_desc = NULL, *xqparser_desc; > > toks = _notmuch_qparser_lex (local, qparser, query_str); > printf("[lex] %s\n", _notmuch_token_show_list (local, toks)); > @@ -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, FALSE); > return qparser; > } > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch > --0016361e81a287e719049a8aa496 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Oops, yes. =A0I'm not sure why you had to initialize qparser_desc = (are you sure it doesn't compile if you omit that?), but a change in th= e later patch 5/8 requires the extra argument to _notmuch_qparser_add_db_pr= efix. =A0I've got another patch with tests for patch 5/8 that adds and = tests the argument that I'll send out shortly (along with tests for the= remaining patches).

Glad to see you're taking advantage of the query pa= rser!

On Sat, Jan 22, 2011 at 11:47 AM,= Michal Sojka <= sojkam1@fel.cvut.cz> wrote:
On Fri, 21 Jan 2011, Aust= in Clements wrote:
> Since wildcard queries require a database, qparser-test can now open a=
> database.

Hi Austin,

I had to apply the following changes in order to be able to compile the
tests (make test).

I'm going to test the parser in my daily use, but so far it looks reall= y
nice. I especially enjoy the before and after searches. Thanks.

-Michal

diff --git a/test/qparser-test.cc b/test/qparser-test.cc
index 18318aa..5be6220 100644
--- a/test/qparser-test.cc
+++ b/test/qparser-test.cc
@@ -61,7 +61,7 @@ test_one (void *ctx, const char *query_str)
=A0 =A0 void *local =3D talloc_new (ctx);
=A0 =A0 Xapian::Query q;
=A0 =A0 _notmuch_token_t *toks, *root;
- =A0 =A0char *error, *qparser_desc, *xqparser_desc;
+ =A0 =A0char *error, *qparser_desc =3D NULL, *xqparser_desc;

=A0 =A0 toks =3D _notmuch_qparser_lex (local, qparser, query_str);
=A0 =A0 printf("[lex] =A0 =A0%s\n", _notmuch_token_show_list (lo= cal, toks));
@@ -100,9 +100,9 @@ static _notmuch_qparser_t *
=A0create_qparser (void *ctx)
=A0{
=A0 =A0 _notmuch_qparser_t *qparser =3D _notmuch_qparser= _create (ctx, notmuch);
- =A0 =A0_notmuch_qparser_add_db_prefix (qparser, "prob", "P= ", FALSE);
- =A0 =A0_notmuch_qparser_add_db_prefix (qparser, "lit", "L&= quot;, TRUE);
- =A0 =A0_notmuch_qparser_add_db_prefix (qparser, "tag", "K&= quot;, TRUE);
+ =A0 =A0_notmuch_qparser_add_db_prefix (qparser, "prob", &= quot;P", FALSE, FALSE);
+ =A0 =A0_notmuch_qparser_add_db_prefix (qparser, "lit", "L&= quot;, TRUE, FALSE);
+ =A0 =A0_notmuch_qparser_add_db_prefix (qparser, "tag", "K&= quot;, TRUE, FALSE);
=A0 =A0 return qparser;
=A0}

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

--0016361e81a287e719049a8aa496--