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