[PATCH 1/3] test: fix count test
authorJani Nikula <jani@nikula.org>
Tue, 4 Dec 2012 21:26:31 +0000 (23:26 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:51:29 +0000 (09:51 -0800)
1d/934e4c6210c5f3a6153d201142a6944cf58c63 [new file with mode: 0644]

diff --git a/1d/934e4c6210c5f3a6153d201142a6944cf58c63 b/1d/934e4c6210c5f3a6153d201142a6944cf58c63
new file mode 100644 (file)
index 0000000..a16d1f5
--- /dev/null
@@ -0,0 +1,131 @@
+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 2CB1E431FC0\r
+       for <notmuch@notmuchmail.org>; Tue,  4 Dec 2012 13:26:43 -0800 (PST)\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 95B912dS3Qxm for <notmuch@notmuchmail.org>;\r
+       Tue,  4 Dec 2012 13:26:42 -0800 (PST)\r
+Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com\r
+       [209.85.217.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 7B57C431FB6\r
+       for <notmuch@notmuchmail.org>; Tue,  4 Dec 2012 13:26:42 -0800 (PST)\r
+Received: by mail-lb0-f181.google.com with SMTP id ge1so3919565lbb.26\r
+       for <notmuch@notmuchmail.org>; Tue, 04 Dec 2012 13:26:41 -0800 (PST)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+       d=google.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references\r
+       :in-reply-to:references:x-gm-message-state;\r
+       bh=V0UK6AjaxxuTt0vfJ7CFE7VWo5RM0qoGTbLCcjMFEhM=;\r
+       b=XsJNwXwdKWfg2JfNLaN94p5J039OKh16S4EKWgGsct3PiZE+Bjvh/BImkY5OctSnOh\r
+       DeQqOOsQZnjmWwHJipQLaFSkvlLYHQq+JSawt+RN+mW6/UkiaNc/C8PWE/BzjVqJxNNI\r
+       1SAv8auzYuRDPKu+WGhjHuomS7Ar0x360VptFGq6j8tvHqyq1k+c5MlgK9MDCdIOFHR1\r
+       9duBUGnSMLC4ELpgP+S/PFHOSsYwFjk6F/YUb0Q/yGKtO8qcIdBXtjVEp/4vp8lJDfXY\r
+       9Wc/VSkUx1JbIxeA8pTt3wNQCnCzmBmctoe9PmZdMWL0NB2T7w7H0RjHKcxlWOM2GTRh\r
+       TJHg==\r
+Received: by 10.152.111.68 with SMTP id ig4mr14582442lab.50.1354656400948;\r
+       Tue, 04 Dec 2012 13:26:40 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-fe51df00-27.dhcp.inet.fi.\r
+       [80.223.81.27])\r
+       by mx.google.com with ESMTPS id oj5sm1190391lab.8.2012.12.04.13.26.39\r
+       (version=SSLv3 cipher=OTHER); Tue, 04 Dec 2012 13:26:40 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/3] test: fix count test\r
+Date: Tue,  4 Dec 2012 23:26:31 +0200\r
+Message-Id:\r
+ <0ca075ab5fb0d886d0235c1f0549db8b0b14c9b5.1354656085.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <cover.1354656085.git.jani@nikula.org>\r
+References: <cover.1354656085.git.jani@nikula.org>\r
+In-Reply-To: <cover.1354656085.git.jani@nikula.org>\r
+References: <cover.1354656085.git.jani@nikula.org>\r
+X-Gm-Message-State:\r
+ ALoCoQnzglNwmwuCCD3oBdRyjLyjqrTkNVWynIU3pSGkUSY6s3qdUWf++FKch6kBtf8pq5ZsHMRV\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: Tue, 04 Dec 2012 21:26:43 -0000\r
+\r
+The quoting for ${SEARCH} is broken when it's supposed to be '*', and\r
+it seems tricky to get it right. Just drop the variable and use '*'\r
+directly. Before this, none of the messages ever matched, and the test\r
+was comparing zeros.\r
+---\r
+ test/count |   23 ++++++++++-------------\r
+ 1 file changed, 10 insertions(+), 13 deletions(-)\r
+\r
+diff --git a/test/count b/test/count\r
+index 300b171..8e587ff 100755\r
+--- a/test/count\r
++++ b/test/count\r
+@@ -4,37 +4,34 @@ test_description='"notmuch count" for messages and threads'\r
\r
+ add_email_corpus\r
\r
+-SEARCH="\"*\""\r
+-\r
+ test_begin_subtest "message count is the default for notmuch count"\r
+ test_expect_equal \\r
+-    "`notmuch search --output=messages ${SEARCH} | wc -l`" \\r
+-    "`notmuch count ${SEARCH}`"\r
++    "`notmuch search --output=messages '*' | wc -l`" \\r
++    "`notmuch count '*'`"\r
\r
+ test_begin_subtest "message count with --output=messages"\r
+ test_expect_equal \\r
+-    "`notmuch search --output=messages ${SEARCH} | wc -l`" \\r
+-    "`notmuch count --output=messages ${SEARCH}`"\r
++    "`notmuch search --output=messages '*' | wc -l`" \\r
++    "`notmuch count --output=messages '*'`"\r
\r
+ test_begin_subtest "thread count with --output=threads"\r
+ test_expect_equal \\r
+-    "`notmuch search --output=threads ${SEARCH} | wc -l`" \\r
+-    "`notmuch count --output=threads ${SEARCH}`"\r
++    "`notmuch search --output=threads '*' | wc -l`" \\r
++    "`notmuch count --output=threads '*'`"\r
\r
+ test_begin_subtest "thread count is the default for notmuch search"\r
+ test_expect_equal \\r
+-    "`notmuch search ${SEARCH} | wc -l`" \\r
+-    "`notmuch count --output=threads ${SEARCH}`"\r
++    "`notmuch search '*' | wc -l`" \\r
++    "`notmuch count --output=threads '*'`"\r
\r
+-SEARCH="from:cworth and not from:cworth"\r
+ test_begin_subtest "count with no matching messages"\r
+ test_expect_equal \\r
+     "0" \\r
+-    "`notmuch count --output=messages ${SEARCH}`"\r
++    "`notmuch count --output=messages from:cworth and not from:cworth`"\r
\r
+ test_begin_subtest "count with no matching threads"\r
+ test_expect_equal \\r
+     "0" \\r
+-    "`notmuch count --output=threads ${SEARCH}`"\r
++    "`notmuch count --output=threads from:cworth and not from:cworth`"\r
\r
+ test_done\r
+-- \r
+1.7.10.4\r
+\r