1 Return-Path: <sojkam1@fel.cvut.cz>
\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 156E8431FD0
\r
6 for <notmuch@notmuchmail.org>; Mon, 22 Sep 2014 02:39:36 -0700 (PDT)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id 55k0x0Bi82cQ for <notmuch@notmuchmail.org>;
\r
16 Mon, 22 Sep 2014 02:39:28 -0700 (PDT)
\r
17 Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])
\r
18 by olra.theworths.org (Postfix) with ESMTP id BDF21431FAE
\r
19 for <notmuch@notmuchmail.org>; Mon, 22 Sep 2014 02:39:27 -0700 (PDT)
\r
20 Received: from localhost (unknown [192.168.200.7])
\r
21 by max.feld.cvut.cz (Postfix) with ESMTP id 245123CFEA8;
\r
22 Mon, 22 Sep 2014 11:39:26 +0200 (CEST)
\r
23 X-Virus-Scanned: IMAP STYX AMAVIS
\r
24 Received: from max.feld.cvut.cz ([192.168.200.1])
\r
25 by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new,
\r
27 with ESMTP id 8sAr8mFNSNEe; Mon, 22 Sep 2014 11:39:22 +0200 (CEST)
\r
28 Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])
\r
29 by max.feld.cvut.cz (Postfix) with ESMTP id C26EC5CCE67;
\r
30 Mon, 22 Sep 2014 11:39:22 +0200 (CEST)
\r
31 Received: from wsh by steelpick.2x.cz with local (Exim 4.84)
\r
32 (envelope-from <sojkam1@fel.cvut.cz>)
\r
33 id 1XW05U-0001we-Qo; Mon, 22 Sep 2014 11:39:16 +0200
\r
34 From: Michal Sojka <sojkam1@fel.cvut.cz>
\r
35 To: notmuch@notmuchmail.org
\r
36 Subject: [PATCH 5/5] cli: Add tests for 'search --output=addresses' and
\r
38 Date: Mon, 22 Sep 2014 11:37:59 +0200
\r
39 Message-Id: <1411378679-7307-6-git-send-email-sojkam1@fel.cvut.cz>
\r
40 X-Mailer: git-send-email 2.1.0
\r
41 In-Reply-To: <1411378679-7307-1-git-send-email-sojkam1@fel.cvut.cz>
\r
42 References: <1411378679-7307-1-git-send-email-sojkam1@fel.cvut.cz>
\r
44 Content-Type: text/plain; charset=UTF-8
\r
45 Content-Transfer-Encoding: 8bit
\r
46 X-BeenThere: notmuch@notmuchmail.org
\r
47 X-Mailman-Version: 2.1.13
\r
49 List-Id: "Use and development of the notmuch mail system."
\r
50 <notmuch.notmuchmail.org>
\r
51 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
52 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
53 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
54 List-Post: <mailto:notmuch@notmuchmail.org>
\r
55 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
56 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
57 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
58 X-List-Received-Date: Mon, 22 Sep 2014 09:39:36 -0000
\r
61 test/T090-search-output.sh | 59 +++++++++++++++++++++++++++++++++++++++++++
\r
62 test/T095-search-unique.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++
\r
63 2 files changed, 122 insertions(+)
\r
64 create mode 100755 test/T095-search-unique.sh
\r
66 diff --git a/test/T090-search-output.sh b/test/T090-search-output.sh
\r
67 index 947d572..ebc8c37 100755
\r
68 --- a/test/T090-search-output.sh
\r
69 +++ b/test/T090-search-output.sh
\r
70 @@ -387,6 +387,65 @@ cat <<EOF >EXPECTED
\r
72 test_expect_equal_file OUTPUT EXPECTED
\r
74 +test_begin_subtest "--output=sender"
\r
75 +notmuch search --output=sender '*' | sort >OUTPUT
\r
76 +cat <<EOF >EXPECTED
\r
77 +Adrian Perez de Castro <aperez@igalia.com>
\r
78 +Alexander Botero-Lowry <alex.boterolowry@gmail.com>
\r
79 +Aron Griffis <agriffis@n01se.net>
\r
80 +Carl Worth <cworth@cworth.org>
\r
81 +Chris Wilson <chris@chris-wilson.co.uk>
\r
82 +François Boulogne <boulogne.f@gmail.com>
\r
83 +Ingmar Vanhassel <ingmar@exherbo.org>
\r
84 +Israel Herraiz <isra@herraiz.org>
\r
85 +Jan Janak <jan@ryngle.com>
\r
86 +Jjgod Jiang <gzjjgod@gmail.com>
\r
87 +Keith Packard <keithp@keithp.com>
\r
88 +Lars Kellogg-Stedman <lars@seas.harvard.edu>
\r
89 +Mikhail Gusarov <dottedmag@dottedmag.net>
\r
90 +Olivier Berger <olivier.berger@it-sudparis.eu>
\r
91 +Rolland Santimano <rollandsantimano@yahoo.com>
\r
92 +Stewart Smith <stewart@flamingspork.com>
\r
94 +test_expect_equal_file OUTPUT EXPECTED
\r
96 +test_begin_subtest "--output=recipients"
\r
97 +notmuch search --output=recipients '*' | sort >OUTPUT
\r
98 +cat <<EOF >EXPECTED
\r
99 +Allan McRae <allan@archlinux.org>
\r
100 +Discussion about the Arch User Repository (AUR) <aur-general@archlinux.org>
\r
101 +Keith Packard <keithp@keithp.com>
\r
102 +Mikhail Gusarov <dottedmag@dottedmag.net>
\r
103 +notmuch@notmuchmail.org
\r
104 +olivier.berger@it-sudparis.eu
\r
106 +test_expect_equal_file OUTPUT EXPECTED
\r
108 +test_begin_subtest "--output=addresses"
\r
109 +notmuch search --output=addresses '*' | sort >OUTPUT
\r
110 +cat <<EOF >EXPECTED
\r
111 +Adrian Perez de Castro <aperez@igalia.com>
\r
112 +Alexander Botero-Lowry <alex.boterolowry@gmail.com>
\r
113 +Allan McRae <allan@archlinux.org>
\r
114 +Aron Griffis <agriffis@n01se.net>
\r
115 +Carl Worth <cworth@cworth.org>
\r
116 +Chris Wilson <chris@chris-wilson.co.uk>
\r
117 +Discussion about the Arch User Repository (AUR) <aur-general@archlinux.org>
\r
118 +François Boulogne <boulogne.f@gmail.com>
\r
119 +Ingmar Vanhassel <ingmar@exherbo.org>
\r
120 +Israel Herraiz <isra@herraiz.org>
\r
121 +Jan Janak <jan@ryngle.com>
\r
122 +Jjgod Jiang <gzjjgod@gmail.com>
\r
123 +Keith Packard <keithp@keithp.com>
\r
124 +Lars Kellogg-Stedman <lars@seas.harvard.edu>
\r
125 +Mikhail Gusarov <dottedmag@dottedmag.net>
\r
126 +Olivier Berger <olivier.berger@it-sudparis.eu>
\r
127 +Rolland Santimano <rollandsantimano@yahoo.com>
\r
128 +Stewart Smith <stewart@flamingspork.com>
\r
129 +notmuch@notmuchmail.org
\r
131 +test_expect_equal_file OUTPUT EXPECTED
\r
133 test_begin_subtest "sanitize output for quoted-printable line-breaks in author and subject"
\r
134 add_message "[subject]='two =?ISO-8859-1?Q?line=0A_subject?=
\r
136 diff --git a/test/T095-search-unique.sh b/test/T095-search-unique.sh
\r
137 new file mode 100755
\r
138 index 0000000..8fd8fc0
\r
140 +++ b/test/T095-search-unique.sh
\r
142 +#!/usr/bin/env bash
\r
143 +test_description='address deduplication in "notmuch search --output=addresses"'
\r
146 +add_message '[to]="Real Name <foo@example.com>, Real Name <bar@example.com>"'
\r
147 +add_message '[to]="Nickname <foo@example.com>"' '[cc]="Real Name <Bar@Example.COM>"'
\r
148 +add_message '[to]="Nickname <foo@example.com>"' '[bcc]="Real Name <Bar@Example.COM>"'
\r
150 +test_begin_subtest "--output=recipients"
\r
151 +notmuch search --output=recipients "*" >OUTPUT
\r
152 +cat <<EOF >EXPECTED
\r
153 +Real Name <foo@example.com>
\r
154 +Real Name <bar@example.com>
\r
156 +test_expect_equal_file OUTPUT EXPECTED
\r
158 +test_begin_subtest "--output=recipients --unique=none"
\r
159 +notmuch search --output=recipients --unique=none "*" >OUTPUT
\r
160 +cat <<EOF >EXPECTED
\r
161 +Real Name <foo@example.com>
\r
162 +Real Name <bar@example.com>
\r
163 +Nickname <foo@example.com>
\r
164 +Real Name <Bar@Example.COM>
\r
165 +Nickname <foo@example.com>
\r
166 +Real Name <Bar@Example.COM>
\r
168 +test_expect_equal_file OUTPUT EXPECTED
\r
170 +test_begin_subtest "--output=recipients --unique=addr"
\r
171 +notmuch search --output=recipients --unique=addr "*" >OUTPUT
\r
172 +cat <<EOF >EXPECTED
\r
173 +Real Name <foo@example.com>
\r
174 +Real Name <bar@example.com>
\r
175 +Real Name <Bar@Example.COM>
\r
177 +test_expect_equal_file OUTPUT EXPECTED
\r
179 +test_begin_subtest "--output=recipients --unique=addrfold"
\r
180 +notmuch search --output=recipients --unique=addrfold "*" >OUTPUT
\r
181 +cat <<EOF >EXPECTED
\r
182 +Real Name <foo@example.com>
\r
183 +Real Name <bar@example.com>
\r
185 +test_expect_equal_file OUTPUT EXPECTED
\r
187 +test_begin_subtest "--output=recipients --unique=name"
\r
188 +notmuch search --output=recipients --unique=name "*" >OUTPUT
\r
189 +cat <<EOF >EXPECTED
\r
190 +Real Name <foo@example.com>
\r
191 +Nickname <foo@example.com>
\r
193 +test_expect_equal_file OUTPUT EXPECTED
\r
195 +test_begin_subtest "--output=recipients --unique=name,addrfold"
\r
196 +notmuch search --output=recipients --unique=name,addrfold "*" >OUTPUT
\r
197 +cat <<EOF >EXPECTED
\r
198 +Real Name <foo@example.com>
\r
199 +Real Name <bar@example.com>
\r
200 +Nickname <foo@example.com>
\r
202 +test_expect_equal_file OUTPUT EXPECTED
\r