[PATCH v4 07/13] test: add tests for the new boolean folder: and path: prefixes
authorJani Nikula <jani@nikula.org>
Sun, 9 Mar 2014 21:40:28 +0000 (23:40 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:00:32 +0000 (10:00 -0800)
19/ac3f55b971259e264c3891b41115a84e622d2b [new file with mode: 0644]

diff --git a/19/ac3f55b971259e264c3891b41115a84e622d2b b/19/ac3f55b971259e264c3891b41115a84e622d2b
new file mode 100644 (file)
index 0000000..9097f99
--- /dev/null
@@ -0,0 +1,187 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id B0986431FD5\r
+       for <notmuch@notmuchmail.org>; Sun,  9 Mar 2014 14:41:35 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id HWyIPgD-3JBE for <notmuch@notmuchmail.org>;\r
+       Sun,  9 Mar 2014 14:41:30 -0700 (PDT)\r
+Received: from mail-la0-f51.google.com (mail-la0-f51.google.com\r
+       [209.85.215.51]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 334CE431FBF\r
+       for <notmuch@notmuchmail.org>; Sun,  9 Mar 2014 14:40:56 -0700 (PDT)\r
+Received: by mail-la0-f51.google.com with SMTP id pv20so4198532lab.10\r
+       for <notmuch@notmuchmail.org>; Sun, 09 Mar 2014 14:40:54 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=1e100.net; s=20130820;\r
+       h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
+       :references:in-reply-to:references;\r
+       bh=4OpZuVyEl0PXGFeUj0EV4e496WClf4aRY5QMoCAszJ8=;\r
+       b=Egc3MwP/Ec+xPa+o4iKGUoZ1XxUaDQTRMmXKGjaClLicOghf/VfW3hDJM146oAbvfD\r
+       oqM4UhMKCB8D3df1EnZ9jtxQzWadliJRQR49bm5442kOZGZe0enCIcohkZlv8mC75m7d\r
+       y2FgD81ATf7WSJGJZbnjdqO3FBv2+xVAePK12Bo+hXyVYZOsOoieTPG5pGwZxk+GypzY\r
+       Bg6dmwIfd/YgOXGLn7k+XZbj3iF5v3LcKSbluR/8gYFXMhD2AuEQpbZij4d+Dz6TdebO\r
+       kJhIqDoKSArbBC07y+5vUotI736HhXQJ4N1/e8r/Fbp6PDDeve9i+qPcElDEO5JZwth2\r
+       pXLw==\r
+X-Gm-Message-State:\r
+ ALoCoQkfWIgtxMtBG85xoPMlwvNt30AlWJMkaMb8C4VCR4pS/3cs6HX6m3kbLCdpXvsvgwMcXSLL\r
+X-Received: by 10.112.170.234 with SMTP id ap10mr19827764lbc.23.1394401254799;\r
+       Sun, 09 Mar 2014 14:40:54 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
+       [88.195.111.91])\r
+       by mx.google.com with ESMTPSA id r5sm14342141lbb.7.2014.03.09.14.40.53\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Sun, 09 Mar 2014 14:40:54 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v4 07/13] test: add tests for the new boolean folder: and\r
+       path: prefixes\r
+Date: Sun,  9 Mar 2014 23:40:28 +0200\r
+Message-Id:\r
+ <a25fe4d3bdb036152c7ec72783946459d20f03af.1394400503.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.9.0\r
+In-Reply-To: <cover.1394400503.git.jani@nikula.org>\r
+References: <cover.1394400503.git.jani@nikula.org>\r
+In-Reply-To: <cover.1394400503.git.jani@nikula.org>\r
+References: <cover.1394400503.git.jani@nikula.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 09 Mar 2014 21:41:36 -0000\r
+\r
+Additional tests for the boolean folder: and path: prefixes using the\r
+full corpus.\r
+---\r
+ test/T100-search-by-folder.sh | 93 ++++++++++++++++++++++++++++++++++++++++++-\r
+ 1 file changed, 92 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/test/T100-search-by-folder.sh b/test/T100-search-by-folder.sh\r
+index a7f63dd1750c..583bdf5eb086 100755\r
+--- a/test/T100-search-by-folder.sh\r
++++ b/test/T100-search-by-folder.sh\r
+@@ -1,5 +1,5 @@\r
+ #!/usr/bin/env bash\r
+-test_description='"notmuch search" by folder: (with variations)'\r
++test_description='"notmuch search" by folder: and path: (with variations)'\r
+ . ./test-lib.sh\r
\r
+ add_message '[dir]=bad' '[subject]="To the bone"'\r
+@@ -55,4 +55,95 @@ test_begin_subtest "After rename, new path returns result"\r
+ output=$(notmuch search folder:duplicate/bad/olds | notmuch_search_sanitize)\r
+ test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Bears (inbox unread)"\r
\r
++# folder: and path: searches with full corpus\r
++rm -rf $MAIL_DIR\r
++add_email_corpus\r
++\r
++# add some more dupes\r
++cp $MAIL_DIR/foo/new/03:2, $MAIL_DIR/new\r
++cp $MAIL_DIR/bar/baz/05:2, $MAIL_DIR/foo\r
++notmuch new >/dev/null\r
++\r
++test_begin_subtest "folder: search"\r
++output=$(notmuch search --output=files folder:foo | notmuch_search_files_sanitize | sort)\r
++# bar/baz/05:2, is a duplicate of foo/05:2,\r
++# new/03:2, is a duplicate of foo/new/03:2,\r
++test_expect_equal "$output" "MAIL_DIR/bar/baz/05:2,\r
++MAIL_DIR/foo/05:2,\r
++MAIL_DIR/foo/06:2,\r
++MAIL_DIR/foo/cur/07:2,\r
++MAIL_DIR/foo/cur/08:2,\r
++MAIL_DIR/foo/new/03:2,\r
++MAIL_DIR/foo/new/09:2,\r
++MAIL_DIR/foo/new/10:2,\r
++MAIL_DIR/new/03:2,"\r
++\r
++test_begin_subtest "top level folder: search"\r
++output=$(notmuch search --output=files folder:'""' | notmuch_search_files_sanitize | sort)\r
++# bar/18:2, is a duplicate of cur/51:2,\r
++# foo/new/03:2, is a duplicate of new/03:2,\r
++test_expect_equal "$output" "MAIL_DIR/01:2,\r
++MAIL_DIR/02:2,\r
++MAIL_DIR/bar/18:2,\r
++MAIL_DIR/cur/29:2,\r
++MAIL_DIR/cur/30:2,\r
++MAIL_DIR/cur/31:2,\r
++MAIL_DIR/cur/32:2,\r
++MAIL_DIR/cur/33:2,\r
++MAIL_DIR/cur/34:2,\r
++MAIL_DIR/cur/35:2,\r
++MAIL_DIR/cur/36:2,\r
++MAIL_DIR/cur/37:2,\r
++MAIL_DIR/cur/38:2,\r
++MAIL_DIR/cur/39:2,\r
++MAIL_DIR/cur/40:2,\r
++MAIL_DIR/cur/41:2,\r
++MAIL_DIR/cur/42:2,\r
++MAIL_DIR/cur/43:2,\r
++MAIL_DIR/cur/44:2,\r
++MAIL_DIR/cur/45:2,\r
++MAIL_DIR/cur/46:2,\r
++MAIL_DIR/cur/47:2,\r
++MAIL_DIR/cur/48:2,\r
++MAIL_DIR/cur/49:2,\r
++MAIL_DIR/cur/50:2,\r
++MAIL_DIR/cur/51:2,\r
++MAIL_DIR/cur/52:2,\r
++MAIL_DIR/cur/53:2,\r
++MAIL_DIR/foo/new/03:2,\r
++MAIL_DIR/new/03:2,\r
++MAIL_DIR/new/04:2,"\r
++\r
++test_begin_subtest "path: search"\r
++output=$(notmuch search --output=files path:"bar" | notmuch_search_files_sanitize | sort)\r
++# cur/51:2, is a duplicate of bar/18:2,\r
++test_expect_equal "$output" "MAIL_DIR/bar/17:2,\r
++MAIL_DIR/bar/18:2,\r
++MAIL_DIR/cur/51:2,"\r
++\r
++test_begin_subtest "top level path: search"\r
++output=$(notmuch search --output=files path:'""' | notmuch_search_files_sanitize | sort)\r
++test_expect_equal "$output" "MAIL_DIR/01:2,\r
++MAIL_DIR/02:2,"\r
++\r
++test_begin_subtest "recursive path: search"\r
++output=$(notmuch search --output=files path:"bar/**" | notmuch_search_files_sanitize | sort)\r
++# cur/51:2, is a duplicate of bar/18:2,\r
++# foo/05:2, is a duplicate of bar/baz/05:2,\r
++test_expect_equal "$output" "MAIL_DIR/bar/17:2,\r
++MAIL_DIR/bar/18:2,\r
++MAIL_DIR/bar/baz/05:2,\r
++MAIL_DIR/bar/baz/23:2,\r
++MAIL_DIR/bar/baz/24:2,\r
++MAIL_DIR/bar/baz/cur/25:2,\r
++MAIL_DIR/bar/baz/cur/26:2,\r
++MAIL_DIR/bar/baz/new/27:2,\r
++MAIL_DIR/bar/baz/new/28:2,\r
++MAIL_DIR/bar/cur/19:2,\r
++MAIL_DIR/bar/cur/20:2,\r
++MAIL_DIR/bar/new/21:2,\r
++MAIL_DIR/bar/new/22:2,\r
++MAIL_DIR/cur/51:2,\r
++MAIL_DIR/foo/05:2,"\r
++\r
+ test_done\r
+-- \r
+1.9.0\r
+\r