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 5E0EA6DE0BB8 for ; Wed, 21 Aug 2019 05:25:19 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.052 X-Spam-Level: X-Spam-Status: No, score=-0.052 tagged_above=-999 required=5 tests=[AWL=-0.051, SPF_PASS=-0.001] 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 43_cwVOu_Zug for ; Wed, 21 Aug 2019 05:25:18 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 96A7B6DE0F54 for ; Wed, 21 Aug 2019 05:25:18 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1i0P2f-0002KO-Kd; Wed, 21 Aug 2019 07:44:41 -0400 Received: (nullmailer pid 23853 invoked by uid 1000); Wed, 21 Aug 2019 11:41:27 -0000 From: David Bremner To: "Rollins, Jameson" , David Bremner , "Jorge P. de Morais Neto" , "notmuch@notmuchmail.org" Subject: [PATCH 3/3] WIP/test: extend field grouping tests Date: Wed, 21 Aug 2019 08:41:26 -0300 Message-Id: <20190821114126.23540-4-david@tethera.net> X-Mailer: git-send-email 2.23.0.rc1 In-Reply-To: <20190821114126.23540-1-david@tethera.net> References: <87v9urjch9.fsf@caltech.edu> <20190821114126.23540-1-david@tethera.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: Wed, 21 Aug 2019 12:25:19 -0000 --- test/T760-implicit-operators.sh | 60 +++++++++++++++++++++++++++------ 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/test/T760-implicit-operators.sh b/test/T760-implicit-operators.sh index 1a6ba61f..438f766f 100755 --- a/test/T760-implicit-operators.sh +++ b/test/T760-implicit-operators.sh @@ -2,16 +2,16 @@ 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_prob_AND() { + add_message "[$1]=alpha@beta" + add_message "[$1]=beta@gamma" - test_begin_subtest "$1: implicitly joined by AND" + test_begin_subtest "probabilistic field '$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 + notmuch count $1:alpha@beta > OUTPUT + notmuch count $1:alpha $1:beta >> OUTPUT + notmuch count $1:alpha@beta OR $1:beta@gamma >> OUTPUT + notmuch count $1:alpha@beta $1:beta@gamma >> OUTPUT cat < EXPECTED 1 1 @@ -21,8 +21,46 @@ EOF test_expect_equal_file EXPECTED OUTPUT } -test_AND from -test_AND subject -test_AND to +test_regex_AND() { + test_begin_subtest "regex field '$1:' implicitly joined by AND" + $2 + notmuch count $1:alpha@beta > OUTPUT + notmuch count $1:/alpha/ $1:/beta/ >> OUTPUT + notmuch count $1:alpha@beta OR $1:beta@gamma >> OUTPUT + notmuch count $1:alpha@beta $1:beta@gamma >> OUTPUT + cat < EXPECTED +1 +1 +2 +0 +EOF + test_expect_equal_file EXPECTED OUTPUT +} + +test_prob_AND from +test_prob_AND subject +test_prob_AND to + + +add_message "[id]=alpha@beta" +add_message "[id]=beta@gamma" + +test_regex_AND mid + +test_begin_subtest "'id:' implicitly joined by OR" +notmuch count id:alpha@beta > OUTPUT +notmuch count id:alpha@beta OR id:beta@gamma >> OUTPUT +notmuch count id:alpha@beta id:beta@gamma >> OUTPUT +cat < EXPECTED +1 +2 +2 +EOF +test_expect_equal_file EXPECTED OUTPUT + +notmuch tag +alpha@beta id:alpha@beta +notmuch tag +beta@gamma id:beta@gamma + +test_regex_AND tag test_done -- 2.23.0.rc1