From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 3C8056DE0BB6 for ; Sun, 25 Aug 2019 02:33:25 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0.412 X-Spam-Level: X-Spam-Status: No, score=0.412 tagged_above=-999 required=5 tests=[AWL=-0.240, SPF_NEUTRAL=0.652] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id gb1qudZ1_cMW for ; Sun, 25 Aug 2019 02:33:23 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by arlo.cworth.org (Postfix) with ESMTP id 2433F6DE0944 for ; Sun, 25 Aug 2019 02:33:22 -0700 (PDT) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id A600510008E for ; Sun, 25 Aug 2019 12:33:17 +0300 (EEST) From: Tomi Ollila To: "notmuch\@notmuchmail.org" Subject: Re: [PATCH 1/3] test: add known broken tests for from: and subject: In-Reply-To: <20190821114126.23540-2-david@tethera.net> References: <87v9urjch9.fsf@caltech.edu> <20190821114126.23540-1-david@tethera.net> <20190821114126.23540-2-david@tethera.net> User-Agent: Notmuch/0.28.3+84~g41389bb (https://notmuchmail.org) Emacs/25.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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, 25 Aug 2019 09:33:25 -0000 On Wed, Aug 21 2019, David Bremner wrote: > Given we want 'a b' to parse as 'a AND b', then for any > probabilistic (free text) prefix foo:, we should also get 'foo:a > foo:b' expanding to 'foo:a AND foo:b'. Currently this is not true due > to the implimentation of regex fields. implementation =D > --- > test/T760-implicit-operators.sh | 28 ++++++++++++++++++++++++++++ > 1 file changed, 28 insertions(+) > create mode 100755 test/T760-implicit-operators.sh > > diff --git a/test/T760-implicit-operators.sh b/test/T760-implicit-operators.sh > new file mode 100755 > index 00000000..b79673df > --- /dev/null > +++ b/test/T760-implicit-operators.sh > @@ -0,0 +1,28 @@ > +#!/usr/bin/env bash > +test_description='implicit operators in query parser' > +. $(dirname "$0")/test-lib.sh || exit 1 > + > +test_AND() { > + add_message "[$1]=a@b" > + add_message "[$1]=b@c" > + > + test_begin_subtest "$1: implicitly joined by AND" > + $2 > + notmuch count $1:a@b > OUTPUT > + notmuch count $1:a $1:b >> OUTPUT > + notmuch count $1:a@b OR $1:b@c >> OUTPUT > + notmuch count $1:a@b $1:b@c >> OUTPUT > + cat < EXPECTED > +1 > +1 > +2 > +0 > +EOF the above could be done printf %s\\n 1 1 2 0 > EXPECTED (whichever way is "clearer" -- using '%s\n' or even "%s\n" is also possible (just increasingly harder to write ;D)) Tomi > + test_expect_equal_file EXPECTED OUTPUT > +} > + > +test_AND from test_subtest_known_broken > +test_AND subject test_subtest_known_broken > +test_AND to > + > +test_done > -- > 2.23.0.rc1