--- /dev/null
+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 arlo.cworth.org (Postfix) with ESMTP id 87CA76DE02D2\r
+ for <notmuch@notmuchmail.org>; Fri, 25 Sep 2015 10:08:31 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.521\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.521 tagged_above=-999 required=5 tests=[AWL=0.199,\r
+ RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id pJUtgyT3F1Pl for <notmuch@notmuchmail.org>;\r
+ Fri, 25 Sep 2015 10:08:28 -0700 (PDT)\r
+Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com\r
+ [209.85.212.173])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 609A96DE0298\r
+ for <notmuch@notmuchmail.org>; Fri, 25 Sep 2015 10:08:28 -0700 (PDT)\r
+Received: by wicge5 with SMTP id ge5so29495462wic.0\r
+ for <notmuch@notmuchmail.org>; Fri, 25 Sep 2015 10:08:27 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\r
+ :references:mime-version:content-type:content-transfer-encoding;\r
+ bh=Brcvb2k1mB8bqhvGDXHlWeDyVmPTCaHt1TlEi3eXIyA=;\r
+ b=R75ipx4uCsxSQ0c0VuzJHfzuy3F8Y6CLTgWFA3Gel8eE50o6gJj0KF0fcoJmr0PiCX\r
+ TM1DvnSBejKCR0ezofI2fwt0H2w/t/N77PJkJNy/YwJYuiXzWW00LCcTuItViGt590Hl\r
+ GDgcpK8ekadSQ6sI7nSG8UsQ6Dt9CNXfx3MoV/LUNdmWh2v1wLM1VhqWTwGFEROugLR/\r
+ QTGLz+IRdqM27Nq2K9IwEdHb296g9yTD204260mE+b3gbpoEqMDBaCw/b1enWUpJtVe7\r
+ 99Pi1vQ+H53UiN25JNv/7pfhHMYNnsuQ+dhjrgoTObJHHpyq5+qV579X46HsitAptSjr\r
+ 9ICw==\r
+X-Gm-Message-State:\r
+ ALoCoQmBs5USjspCRVk4dvu7pnR4JfapbKm21nnOn4FoRncfFLOuhFYLz89Qioer3rA5BxlJ2D6N\r
+X-Received: by 10.194.83.70 with SMTP id o6mr7418689wjy.44.1443200906920;\r
+ Fri, 25 Sep 2015 10:08:26 -0700 (PDT)\r
+Received: from localhost (mobile-access-bcee63-221.dhcp.inet.fi.\r
+ [188.238.99.221])\r
+ by smtp.gmail.com with ESMTPSA id 12sm4272173wjw.15.2015.09.25.10.08.26\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Fri, 25 Sep 2015 10:08:26 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: David Bremner <david@tethera.net>, Jani Nikula <jani@nikula.org>,\r
+ notmuch@notmuchmail.org\r
+Subject: =?utf-8?q?=5BPATCH_v2_7=C2=BD/9=5D_test=3A_add_notmuch_address_--deduplicate=3D=28no=7Cmailbox=7Caddress=29_tests?=\r
+Date: Fri, 25 Sep 2015 20:08:09 +0300\r
+Message-Id: <1443200889-19053-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <87612z2wo7.fsf@zancas.localnet>\r
+References: <87612z2wo7.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: 8bit\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\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: Fri, 25 Sep 2015 17:08:31 -0000\r
+\r
+First a simple smoke test first, next generate messages with multiple\r
+email address variants and check the behaviour of deduplication\r
+schemes with these.\r
+\r
+---\r
+\r
+v2: more variation in name parts of email addresses\r
+---\r
+ test/T095-address.sh | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+ 1 file changed, 74 insertions(+)\r
+\r
+diff --git a/test/T095-address.sh b/test/T095-address.sh\r
+index f8d902cb3a5e..a194faf3b842 100755\r
+--- a/test/T095-address.sh\r
++++ b/test/T095-address.sh\r
+@@ -215,4 +215,78 @@ notmuch@notmuchmail.org\r
+ EOF\r
+ test_expect_equal_file OUTPUT EXPECTED\r
+ \r
++test_begin_subtest "--deduplicate=address --output=sender --output=recipients"\r
++notmuch address --deduplicate=address --output=sender --output=recipients '*' | sort >OUTPUT\r
++cat <<EOF >EXPECTED\r
++"Discussion about the Arch User Repository (AUR)" <aur-general@archlinux.org>\r
++Adrian Perez de Castro <aperez@igalia.com>\r
++Alexander Botero-Lowry <alex.boterolowry@gmail.com>\r
++Allan McRae <allan@archlinux.org>\r
++Aron Griffis <agriffis@n01se.net>\r
++Carl Worth <cworth@cworth.org>\r
++Chris Wilson <chris@chris-wilson.co.uk>\r
++François Boulogne <boulogne.f@gmail.com>\r
++Ingmar Vanhassel <ingmar@exherbo.org>\r
++Israel Herraiz <isra@herraiz.org>\r
++Jan Janak <jan@ryngle.com>\r
++Jjgod Jiang <gzjjgod@gmail.com>\r
++Keith Packard <keithp@keithp.com>\r
++Lars Kellogg-Stedman <lars@seas.harvard.edu>\r
++Mikhail Gusarov <dottedmag@dottedmag.net>\r
++Olivier Berger <olivier.berger@it-sudparis.eu>\r
++Rolland Santimano <rollandsantimano@yahoo.com>\r
++Stewart Smith <stewart@flamingspork.com>\r
++notmuch@notmuchmail.org\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++generate_message '[from]="Foo Bar <foo.bar@example.com>"'\r
++generate_message '[from]="Foo Bar <Foo.Bar@Example.Com>"'\r
++generate_message '[from]="Foo Bar <foo.bar@example.com>"'\r
++generate_message '[from]="Bar <Foo.Bar@Example.Com>"'\r
++generate_message '[from]="Foo <foo.bar@example.com>"'\r
++generate_message '[from]="<foo.bar@example.com>"'\r
++generate_message '[from]="foo.bar@example.com"'\r
++generate_message '[from]="Baz <foo.bar+baz@example.com>"'\r
++generate_message '[from]="Foo Bar <foo.bar+baz@example.com>"'\r
++generate_message '[from]="Baz <foo.bar+baz@example.com>"'\r
++notmuch new > /dev/null\r
++\r
++test_begin_subtest "--deduplicate=no --output=sender"\r
++notmuch address --deduplicate=no --output=sender from:example.com | sort >OUTPUT\r
++cat <<EOF >EXPECTED\r
++Bar <Foo.Bar@Example.Com>\r
++Baz <foo.bar+baz@example.com>\r
++Baz <foo.bar+baz@example.com>\r
++Foo <foo.bar@example.com>\r
++Foo Bar <Foo.Bar@Example.Com>\r
++Foo Bar <foo.bar+baz@example.com>\r
++Foo Bar <foo.bar@example.com>\r
++Foo Bar <foo.bar@example.com>\r
++foo.bar@example.com\r
++foo.bar@example.com\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "--deduplicate=mailbox --output=sender --output=count"\r
++notmuch address --deduplicate=mailbox --output=sender --output=count from:example.com | sort -n >OUTPUT\r
++cat <<EOF >EXPECTED\r
++1 Bar <Foo.Bar@Example.Com>\r
++1 Foo <foo.bar@example.com>\r
++1 Foo Bar <Foo.Bar@Example.Com>\r
++1 Foo Bar <foo.bar+baz@example.com>\r
++2 Baz <foo.bar+baz@example.com>\r
++2 Foo Bar <foo.bar@example.com>\r
++2 foo.bar@example.com\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "--deduplicate=address --output=sender --output=count"\r
++notmuch address --deduplicate=address --output=sender --output=count from:example.com | sort -n >OUTPUT\r
++cat <<EOF >EXPECTED\r
++3 Baz <foo.bar+baz@example.com>\r
++7 Foo Bar <foo.bar@example.com>\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
+ test_done\r
+-- \r
+2.1.4\r
+\r