Re: [PATCH 3.5/8] Query parser tests for wildcard queries.

Subject: Re: [PATCH 3.5/8] Query parser tests for wildcard queries.

Date: Sun, 23 Jan 2011 17:02:43 -0500

To: Michal Sojka

Cc: notmuch@notmuchmail.org

From: Austin Clements


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 <sojkam1@fel.cvut.cz> 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
>

Thread: