1 Return-Path: <jani@nikula.org>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id A9009429E31
\r
6 for <notmuch@notmuchmail.org>; Fri, 4 Nov 2011 13:25:31 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"
\r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5
\r
13 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled
\r
14 Received: from olra.theworths.org ([127.0.0.1])
\r
15 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
16 with ESMTP id cYfeKW8Smc9j for <notmuch@notmuchmail.org>;
\r
17 Fri, 4 Nov 2011 13:25:31 -0700 (PDT)
\r
18 Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com
\r
19 [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))
\r
20 (No client certificate requested)
\r
21 by olra.theworths.org (Postfix) with ESMTPS id 202E4429E2F
\r
22 for <notmuch@notmuchmail.org>; Fri, 4 Nov 2011 13:25:30 -0700 (PDT)
\r
23 Received: by mail-fx0-f53.google.com with SMTP id n15so52582faa.26
\r
24 for <notmuch@notmuchmail.org>; Fri, 04 Nov 2011 13:25:29 -0700 (PDT)
\r
25 Received: by 10.223.77.66 with SMTP id f2mr26251242fak.24.1320438329514;
\r
26 Fri, 04 Nov 2011 13:25:29 -0700 (PDT)
\r
27 Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi.
\r
29 by mx.google.com with ESMTPS id l26sm18277134fad.17.2011.11.04.13.25.28
\r
30 (version=SSLv3 cipher=OTHER); Fri, 04 Nov 2011 13:25:29 -0700 (PDT)
\r
31 From: Jani Nikula <jani@nikula.org>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH v3 5/7] test: add tests for notmuch count
\r
34 Date: Fri, 4 Nov 2011 22:25:13 +0200
\r
36 <0a273fb12ba036646530ba4b9005e96ff0e2d0d3.1320349030.git.jani@nikula.org>
\r
37 X-Mailer: git-send-email 1.7.5.4
\r
38 In-Reply-To: <cover.1320349030.git.jani@nikula.org>
\r
39 References: <cover.1320349030.git.jani@nikula.org>
\r
40 In-Reply-To: <cover.1320349030.git.jani@nikula.org>
\r
41 References: <cover.1320349030.git.jani@nikula.org>
\r
42 Cc: amdragon@mit.edu
\r
43 X-BeenThere: notmuch@notmuchmail.org
\r
44 X-Mailman-Version: 2.1.13
\r
46 List-Id: "Use and development of the notmuch mail system."
\r
47 <notmuch.notmuchmail.org>
\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
49 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
51 List-Post: <mailto:notmuch@notmuchmail.org>
\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
54 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
55 X-List-Received-Date: Fri, 04 Nov 2011 20:25:31 -0000
\r
57 Signed-off-by: Jani Nikula <jani@nikula.org>
\r
59 test/count | 40 ++++++++++++++++++++++++++++++++++++++++
\r
60 test/notmuch-test | 1 +
\r
61 2 files changed, 41 insertions(+), 0 deletions(-)
\r
62 create mode 100755 test/count
\r
64 diff --git a/test/count b/test/count
\r
65 new file mode 100755
\r
66 index 0000000..300b171
\r
70 +#!/usr/bin/env bash
\r
71 +test_description='"notmuch count" for messages and threads'
\r
78 +test_begin_subtest "message count is the default for notmuch count"
\r
79 +test_expect_equal \
\r
80 + "`notmuch search --output=messages ${SEARCH} | wc -l`" \
\r
81 + "`notmuch count ${SEARCH}`"
\r
83 +test_begin_subtest "message count with --output=messages"
\r
84 +test_expect_equal \
\r
85 + "`notmuch search --output=messages ${SEARCH} | wc -l`" \
\r
86 + "`notmuch count --output=messages ${SEARCH}`"
\r
88 +test_begin_subtest "thread count with --output=threads"
\r
89 +test_expect_equal \
\r
90 + "`notmuch search --output=threads ${SEARCH} | wc -l`" \
\r
91 + "`notmuch count --output=threads ${SEARCH}`"
\r
93 +test_begin_subtest "thread count is the default for notmuch search"
\r
94 +test_expect_equal \
\r
95 + "`notmuch search ${SEARCH} | wc -l`" \
\r
96 + "`notmuch count --output=threads ${SEARCH}`"
\r
98 +SEARCH="from:cworth and not from:cworth"
\r
99 +test_begin_subtest "count with no matching messages"
\r
100 +test_expect_equal \
\r
102 + "`notmuch count --output=messages ${SEARCH}`"
\r
104 +test_begin_subtest "count with no matching threads"
\r
105 +test_expect_equal \
\r
107 + "`notmuch count --output=threads ${SEARCH}`"
\r
110 diff --git a/test/notmuch-test b/test/notmuch-test
\r
111 index 738f8f6..587adb5 100755
\r
112 --- a/test/notmuch-test
\r
113 +++ b/test/notmuch-test
\r
114 @@ -19,6 +19,7 @@ cd $(dirname "$0")
\r