[PATCH 7½/9] test: add notmuch address --deduplicate=(no|mailbox|address) tests
[notmuch-archives.git] / a3 / 6f7000f4f52d93e76989e8111e9a4e6fe7fb97
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 arlo.cworth.org (Postfix) with ESMTP id 350A96DE14C7\r
6  for <notmuch@notmuchmail.org>; Fri,  4 Sep 2015 11:38:56 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at cworth.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.486\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.486 tagged_above=-999 required=5 tests=[AWL=0.234,\r
12   RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01]\r
13  autolearn=disabled\r
14 Received: from arlo.cworth.org ([127.0.0.1])\r
15  by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
16  with ESMTP id MtBB38AOzSNM for <notmuch@notmuchmail.org>;\r
17  Fri,  4 Sep 2015 11:38:54 -0700 (PDT)\r
18 Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com\r
19  [209.85.212.178])\r
20  by arlo.cworth.org (Postfix) with ESMTPS id 8EE526DE147C\r
21  for <notmuch@notmuchmail.org>; Fri,  4 Sep 2015 11:38:53 -0700 (PDT)\r
22 Received: by wiclk2 with SMTP id lk2so31284169wic.0\r
23  for <notmuch@notmuchmail.org>; Fri, 04 Sep 2015 11:38:52 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25  d=1e100.net; s=20130820;\r
26  h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\r
27  :references:mime-version:content-type:content-transfer-encoding;\r
28  bh=Ju/Ncdqhmquj9ib+DrTINAS4qgBoo0T/Ts5DB6fnldA=;\r
29  b=cMkWs+cpKYjpp0UdT6e560Q50zDhgG0EtMI2iePD7ZA7V8tfGzdJqUnz6zgWGzk+HL\r
30  GyYEi6CKOSwPnY3k1N/JKKSOKvXHNG1m8phec/qFwn7PeosVoLCAQQX5QLANtGR3Tqgi\r
31  1ZX+Tcib+Y3bDQQP7KTcbsj1rcc5y4NJj3jcuwCIIqMH9ekAYauO3kW6eLLloVj6mf5s\r
32  Vldiktk4dR81KSMzqGP5y1MQAkD8vJEX8pD/jZJTCesIdU2VOVKS908Gv/gj9gGr0obW\r
33  wVqa22EqKLWT0aIZmGn1YUWCMezZXGpnQInshr5u2U1X2lz0MjibIkTB8n10/OxSasbM\r
34  EFyA==\r
35 X-Gm-Message-State:\r
36  ALoCoQknjKwZNFHH+baHQdZBDUzxacMnjh+lmLjtT5Bm5b69732wdYbMbpTCZaVyoXX9+FTbEMTl\r
37 X-Received: by 10.194.59.100 with SMTP id y4mr10119771wjq.151.1441391932079;\r
38  Fri, 04 Sep 2015 11:38:52 -0700 (PDT)\r
39 Received: from localhost (mobile-access-bcee4f-131.dhcp.inet.fi.\r
40  [188.238.79.131])\r
41  by smtp.gmail.com with ESMTPSA id cx3sm4845495wjc.27.2015.09.04.11.38.51\r
42  (version=TLSv1/SSLv3 cipher=OTHER);\r
43  Fri, 04 Sep 2015 11:38:51 -0700 (PDT)\r
44 From: Jani Nikula <jani@nikula.org>\r
45 To: Jani Nikula <jani@nikula.org>,\r
46         notmuch@notmuchmail.org\r
47 Subject: =?utf-8?q?=5BPATCH_7=C2=BD/9=5D_test=3A_add_notmuch_address_--deduplicate=3D=28no=7Cmailbox=7Caddress=29_tests?=\r
48 Date: Fri,  4 Sep 2015 21:38:47 +0300\r
49 Message-Id: <1441391927-18228-1-git-send-email-jani@nikula.org>\r
50 X-Mailer: git-send-email 2.1.4\r
51 In-Reply-To:\r
52  <e711ba0bd92624352e2366f4f866a406ff25981e.1441308761.git.jani@nikula.org>\r
53 References:\r
54  <e711ba0bd92624352e2366f4f866a406ff25981e.1441308761.git.jani@nikula.org>\r
55 MIME-Version: 1.0\r
56 Content-Type: text/plain; charset=UTF-8\r
57 Content-Transfer-Encoding: 8bit\r
58 X-BeenThere: notmuch@notmuchmail.org\r
59 X-Mailman-Version: 2.1.18\r
60 Precedence: list\r
61 List-Id: "Use and development of the notmuch mail system."\r
62  <notmuch.notmuchmail.org>\r
63 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
64  <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
65 List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
66 List-Post: <mailto:notmuch@notmuchmail.org>\r
67 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
68 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
69  <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
70 X-List-Received-Date: Fri, 04 Sep 2015 18:38:56 -0000\r
71 \r
72 First a simple smoke test first, next generate messages with multiple\r
73 email address variants and check the behaviour of deduplication\r
74 schemes with these.\r
75 ---\r
76  test/T095-address.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++\r
77  1 file changed, 63 insertions(+)\r
78 \r
79 diff --git a/test/T095-address.sh b/test/T095-address.sh\r
80 index f8d902cb3a5e..54ac713a5227 100755\r
81 --- a/test/T095-address.sh\r
82 +++ b/test/T095-address.sh\r
83 @@ -215,4 +215,67 @@ notmuch@notmuchmail.org\r
84  EOF\r
85  test_expect_equal_file OUTPUT EXPECTED\r
86  \r
87 +test_begin_subtest "--deduplicate=address --output=sender --output=recipients"\r
88 +notmuch address --deduplicate=address --output=sender --output=recipients '*' | sort >OUTPUT\r
89 +cat <<EOF >EXPECTED\r
90 +"Discussion about the Arch User Repository (AUR)" <aur-general@archlinux.org>\r
91 +Adrian Perez de Castro <aperez@igalia.com>\r
92 +Alexander Botero-Lowry <alex.boterolowry@gmail.com>\r
93 +Allan McRae <allan@archlinux.org>\r
94 +Aron Griffis <agriffis@n01se.net>\r
95 +Carl Worth <cworth@cworth.org>\r
96 +Chris Wilson <chris@chris-wilson.co.uk>\r
97 +François Boulogne <boulogne.f@gmail.com>\r
98 +Ingmar Vanhassel <ingmar@exherbo.org>\r
99 +Israel Herraiz <isra@herraiz.org>\r
100 +Jan Janak <jan@ryngle.com>\r
101 +Jjgod Jiang <gzjjgod@gmail.com>\r
102 +Keith Packard <keithp@keithp.com>\r
103 +Lars Kellogg-Stedman <lars@seas.harvard.edu>\r
104 +Mikhail Gusarov <dottedmag@dottedmag.net>\r
105 +Olivier Berger <olivier.berger@it-sudparis.eu>\r
106 +Rolland Santimano <rollandsantimano@yahoo.com>\r
107 +Stewart Smith <stewart@flamingspork.com>\r
108 +notmuch@notmuchmail.org\r
109 +EOF\r
110 +test_expect_equal_file OUTPUT EXPECTED\r
111 +\r
112 +generate_message '[from]="Foo Bar <foo.bar@example.com>"'\r
113 +generate_message '[from]="Foo Bar <Foo.Bar@Example.Com>"'\r
114 +generate_message '[from]="Foo Bar <foo.bar@example.com>"'\r
115 +generate_message '[from]="<foo.bar@example.com>"'\r
116 +generate_message '[from]="foo.bar@example.com"'\r
117 +generate_message '[from]="Foo Bar <foo.bar+baz@example.com>"'\r
118 +notmuch new > /dev/null\r
119 +\r
120 +test_begin_subtest "--deduplicate=no --output=sender"\r
121 +notmuch address --deduplicate=no --output=sender from:example.com | sort >OUTPUT\r
122 +cat <<EOF >EXPECTED\r
123 +Foo Bar <Foo.Bar@Example.Com>\r
124 +Foo Bar <foo.bar+baz@example.com>\r
125 +Foo Bar <foo.bar@example.com>\r
126 +Foo Bar <foo.bar@example.com>\r
127 +foo.bar@example.com\r
128 +foo.bar@example.com\r
129 +EOF\r
130 +test_expect_equal_file OUTPUT EXPECTED\r
131 +\r
132 +test_begin_subtest "--deduplicate=mailbox --output=sender --output=count"\r
133 +notmuch address --deduplicate=mailbox --output=sender --output=count from:example.com | sort -n >OUTPUT\r
134 +cat <<EOF >EXPECTED\r
135 +1      Foo Bar <Foo.Bar@Example.Com>\r
136 +1      Foo Bar <foo.bar+baz@example.com>\r
137 +2      Foo Bar <foo.bar@example.com>\r
138 +2      foo.bar@example.com\r
139 +EOF\r
140 +test_expect_equal_file OUTPUT EXPECTED\r
141 +\r
142 +test_begin_subtest "--deduplicate=address --output=sender --output=count"\r
143 +notmuch address --deduplicate=address --output=sender --output=count from:example.com | sort -n >OUTPUT\r
144 +cat <<EOF >EXPECTED\r
145 +1      Foo Bar <foo.bar+baz@example.com>\r
146 +5      Foo Bar <foo.bar@example.com>\r
147 +EOF\r
148 +test_expect_equal_file OUTPUT EXPECTED\r
149 +\r
150  test_done\r
151 -- \r
152 2.1.4\r
153 \r