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 1ED8D431FBD for ; Sat, 8 Mar 2014 18:55:43 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 JkSjhytyuP1b for ; Sat, 8 Mar 2014 18:55:35 -0800 (PST) Received: from dmz-mailsec-scanner-6.mit.edu (dmz-mailsec-scanner-6.mit.edu [18.7.68.35]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 4A3D7431FB6 for ; Sat, 8 Mar 2014 18:55:35 -0800 (PST) X-AuditID: 12074423-f79726d000000cc9-9f-531bd826da19 Received: from mailhub-auth-4.mit.edu ( [18.7.62.39]) (using TLS with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by dmz-mailsec-scanner-6.mit.edu (Symantec Messaging Gateway) with SMTP id 75.42.03273.628DB135; Sat, 8 Mar 2014 21:55:34 -0500 (EST) Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) by mailhub-auth-4.mit.edu (8.13.8/8.9.2) with ESMTP id s292tWcx027618; Sat, 8 Mar 2014 21:55:33 -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.8/8.12.4) with ESMTP id s292tUjj027962 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sat, 8 Mar 2014 21:55:31 -0500 Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80) (envelope-from ) id 1WMTth-0002io-TD; Sat, 08 Mar 2014 21:55:29 -0500 Date: Sat, 8 Mar 2014 21:55:29 -0500 From: Austin Clements To: jani@nikula.org, David Bremner Subject: Re: [Patch v3 08/15] test: add tests for the new boolean folder: and path: prefixes Message-ID: <20140309025529.GM4709@mit.edu> References: <1394313585-28422-1-git-send-email-david@tethera.net> <1394313585-28422-9-git-send-email-david@tethera.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1394313585-28422-9-git-send-email-david@tethera.net> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGKsWRmVeSWpSXmKPExsUixG6nrqt2QzrYYMktYYsbrd2MFk3TnS2u 35zJ7MDscev+a3aPZ6tuMXtsOfSeOYA5issmJTUnsyy1SN8ugSujbfofloJtshWn7/I1MLZK djFyckgImEjcm3iBDcIWk7hwbz2YLSQwm0li1Tb5LkYuIHsDo8Sr7pXsEM4pJomfU08yQThL GCV+zH7GCNLCIqAicWb9dWYQm01AQ2Lb/uVAcQ4OEQEziWnLa0HCzALSEt9+NzOB2MICcRIn Xh1jAbF5BbQlmh/uZYLYXCnRvvIwO0RcUOLkzCcsEL1aEjf+vWQCGQkyZ/k/DpAwp4CTxOS9 O1lBbFGgC6ac3MY2gVFoFpLuWUi6ZyF0L2BkXsUom5JbpZubmJlTnJqsW5ycmJeXWqRrppeb WaKXmlK6iREc5C7KOxj/HFQ6xCjAwajEw/tgknSwEGtiWXFl7iFGSQ4mJVHe7utAIb6k/JTK jMTijPii0pzU4kOMEhzMSiK8LzuBcrwpiZVVqUX5MClpDhYlcd6+sxLBQgLpiSWp2ampBalF MFkZDg4lCd4kkKGCRanpqRVpmTklCGkmDk6Q4TxAw9NAaniLCxJzizPTIfKnGHU55s/694lR iCUvPy9VSpxXHKRIAKQoozQPbg4sOb1iFAd6S5i3BaSKB5jY4Ca9AlrCBLSk+bgUyJKSRISU VAOj7kf98/+Nb1qdUmbUnH6MaVq52Nb5p8yDbv32ebvISyK5v7M+jklh38mEu2XPfi4V5NM8 ul9HSuX8nxVLTP00OhcsagraFHn4/84rexnW7Ay8vG5hqcuXshPxv/TYnyrtSP3jvv4kt+El 7r0pFc0Z5778cXke1dSmJsos1eyXmK/ZZX5+iW+kEktxRqKhFnNRcSIAlH21ESkDAAA= 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, 09 Mar 2014 02:55:43 -0000 Quoth David Bremner on Mar 08 at 5:19 pm: > From: Jani Nikula > > Additional tests for the boolean folder: and path: prefixes using the > new corpus. > --- > test/T101-search-by-folder-and-path.sh | 83 ++++++++++++++++++++++++++++++++++ Would it be possible to fold these in to (or simply improve) T100-search-by-folder.sh? Maybe just concatenate the two and blow away the database in the middle. There's already a lot of ambiguity between the test scripts (do I put Emacs show tests in T310-emacs where most of them are, or in T450-emacs-show?) and it would be unfortunate to introduce more. > 1 file changed, 83 insertions(+) > create mode 100755 test/T101-search-by-folder-and-path.sh > > diff --git a/test/T101-search-by-folder-and-path.sh b/test/T101-search-by-folder-and-path.sh > new file mode 100755 > index 0000000..9f809e4 > --- /dev/null > +++ b/test/T101-search-by-folder-and-path.sh > @@ -0,0 +1,83 @@ > +#!/usr/bin/env bash > +test_description='"notmuch search" by folder: and path:' > +. ./test-lib.sh > + > +add_email_corpus folders > + > +test_begin_subtest "folder: search" > +output=$(notmuch search --output=files folder:foo | sed -e "s,$MAIL_DIR,MAIL_DIR," | sort) No need to do this in this series, but it would be nice if this canonicalization were put into a function in test-lib, since we do it in a lot of places. > +# bar/baz/05:2, and new/03:2, are duplicates of foo/05:2, and > +# foo/new/03:2, respectively > +test_expect_equal "$output" "MAIL_DIR/bar/baz/05:2, > +MAIL_DIR/foo/05:2, > +MAIL_DIR/foo/06:2, > +MAIL_DIR/foo/cur/07:2, > +MAIL_DIR/foo/cur/08:2, > +MAIL_DIR/foo/new/03:2, > +MAIL_DIR/foo/new/09:2, > +MAIL_DIR/foo/new/10:2, > +MAIL_DIR/new/03:2," > + > +test_begin_subtest "top level folder: search" > +output=$(notmuch search --output=files folder:'""' | sed -e "s,$MAIL_DIR,MAIL_DIR," | sort) > +# foo/new/03:2, is a duplicate of new/03:2, > +test_expect_equal "$output" "MAIL_DIR/01:2, > +MAIL_DIR/02:2, > +MAIL_DIR/cur/29:2, > +MAIL_DIR/cur/30:2, > +MAIL_DIR/cur/31:2, > +MAIL_DIR/cur/32:2, > +MAIL_DIR/cur/33:2, > +MAIL_DIR/cur/34:2, > +MAIL_DIR/cur/35:2, > +MAIL_DIR/cur/36:2, > +MAIL_DIR/cur/37:2, > +MAIL_DIR/cur/38:2, > +MAIL_DIR/cur/39:2, > +MAIL_DIR/cur/40:2, > +MAIL_DIR/cur/41:2, > +MAIL_DIR/cur/42:2, > +MAIL_DIR/cur/43:2, > +MAIL_DIR/cur/44:2, > +MAIL_DIR/cur/45:2, > +MAIL_DIR/cur/46:2, > +MAIL_DIR/cur/47:2, > +MAIL_DIR/cur/48:2, > +MAIL_DIR/cur/49:2, > +MAIL_DIR/cur/50:2, > +MAIL_DIR/cur/52:2, > +MAIL_DIR/cur/53:2, > +MAIL_DIR/foo/new/03:2, > +MAIL_DIR/new/03:2, > +MAIL_DIR/new/04:2," > + > +test_begin_subtest "path: search" > +output=$(notmuch search --output=files path:"bar" | sed -e "s,$MAIL_DIR,MAIL_DIR," | sort) > +# foo/05:2, is a duplicate of bar/baz/05:2, > +test_expect_equal "$output" "MAIL_DIR/bar/17:2, > +MAIL_DIR/bar/18:2," > + > +test_begin_subtest "top level path: search" > +output=$(notmuch search --output=files path:'""' | sed -e "s,$MAIL_DIR,MAIL_DIR," | sort) > +test_expect_equal "$output" "MAIL_DIR/01:2, > +MAIL_DIR/02:2," > + > +test_begin_subtest "recursive path: search" > +output=$(notmuch search --output=files path:"bar/**" | sed -e "s,$MAIL_DIR,MAIL_DIR," | sort) > +# foo/05:2, is a duplicate of bar/baz/05:2, > +test_expect_equal "$output" "MAIL_DIR/bar/17:2, > +MAIL_DIR/bar/18:2, > +MAIL_DIR/bar/baz/05:2, > +MAIL_DIR/bar/baz/23:2, > +MAIL_DIR/bar/baz/24:2, > +MAIL_DIR/bar/baz/cur/25:2, > +MAIL_DIR/bar/baz/cur/26:2, > +MAIL_DIR/bar/baz/new/27:2, > +MAIL_DIR/bar/baz/new/28:2, > +MAIL_DIR/bar/cur/19:2, > +MAIL_DIR/bar/cur/20:2, > +MAIL_DIR/bar/new/21:2, > +MAIL_DIR/bar/new/22:2, > +MAIL_DIR/foo/05:2," > + > +test_done