--- /dev/null
+Return-Path: <sojkam1@fel.cvut.cz>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id 156E8431FD0\r
+ for <notmuch@notmuchmail.org>; Mon, 22 Sep 2014 02:39:36 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id 55k0x0Bi82cQ for <notmuch@notmuchmail.org>;\r
+ Mon, 22 Sep 2014 02:39:28 -0700 (PDT)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+ by olra.theworths.org (Postfix) with ESMTP id BDF21431FAE\r
+ for <notmuch@notmuchmail.org>; Mon, 22 Sep 2014 02:39:27 -0700 (PDT)\r
+Received: from localhost (unknown [192.168.200.7])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 245123CFEA8;\r
+ Mon, 22 Sep 2014 11:39:26 +0200 (CEST)\r
+X-Virus-Scanned: IMAP STYX AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+ by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new,\r
+ port 10044)\r
+ with ESMTP id 8sAr8mFNSNEe; Mon, 22 Sep 2014 11:39:22 +0200 (CEST)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id C26EC5CCE67;\r
+ Mon, 22 Sep 2014 11:39:22 +0200 (CEST)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.84)\r
+ (envelope-from <sojkam1@fel.cvut.cz>)\r
+ id 1XW05U-0001we-Qo; Mon, 22 Sep 2014 11:39:16 +0200\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 5/5] cli: Add tests for 'search --output=addresses' and\r
+ similar\r
+Date: Mon, 22 Sep 2014 11:37:59 +0200\r
+Message-Id: <1411378679-7307-6-git-send-email-sojkam1@fel.cvut.cz>\r
+X-Mailer: git-send-email 2.1.0\r
+In-Reply-To: <1411378679-7307-1-git-send-email-sojkam1@fel.cvut.cz>\r
+References: <1411378679-7307-1-git-send-email-sojkam1@fel.cvut.cz>\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.13\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: Mon, 22 Sep 2014 09:39:36 -0000\r
+\r
+---\r
+ test/T090-search-output.sh | 59 +++++++++++++++++++++++++++++++++++++++++++\r
+ test/T095-search-unique.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++\r
+ 2 files changed, 122 insertions(+)\r
+ create mode 100755 test/T095-search-unique.sh\r
+\r
+diff --git a/test/T090-search-output.sh b/test/T090-search-output.sh\r
+index 947d572..ebc8c37 100755\r
+--- a/test/T090-search-output.sh\r
++++ b/test/T090-search-output.sh\r
+@@ -387,6 +387,65 @@ cat <<EOF >EXPECTED\r
+ EOF\r
+ test_expect_equal_file OUTPUT EXPECTED\r
+ \r
++test_begin_subtest "--output=sender"\r
++notmuch search --output=sender '*' | sort >OUTPUT\r
++cat <<EOF >EXPECTED\r
++Adrian Perez de Castro <aperez@igalia.com>\r
++Alexander Botero-Lowry <alex.boterolowry@gmail.com>\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
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "--output=recipients"\r
++notmuch search --output=recipients '*' | sort >OUTPUT\r
++cat <<EOF >EXPECTED\r
++Allan McRae <allan@archlinux.org>\r
++Discussion about the Arch User Repository (AUR) <aur-general@archlinux.org>\r
++Keith Packard <keithp@keithp.com>\r
++Mikhail Gusarov <dottedmag@dottedmag.net>\r
++notmuch@notmuchmail.org\r
++olivier.berger@it-sudparis.eu\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "--output=addresses"\r
++notmuch search --output=addresses '*' | sort >OUTPUT\r
++cat <<EOF >EXPECTED\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
++Discussion about the Arch User Repository (AUR) <aur-general@archlinux.org>\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
+ test_begin_subtest "sanitize output for quoted-printable line-breaks in author and subject"\r
+ add_message "[subject]='two =?ISO-8859-1?Q?line=0A_subject?=\r
+ headers'"\r
+diff --git a/test/T095-search-unique.sh b/test/T095-search-unique.sh\r
+new file mode 100755\r
+index 0000000..8fd8fc0\r
+--- /dev/null\r
++++ b/test/T095-search-unique.sh\r
+@@ -0,0 +1,63 @@\r
++#!/usr/bin/env bash\r
++test_description='address deduplication in "notmuch search --output=addresses"'\r
++. ./test-lib.sh\r
++\r
++add_message '[to]="Real Name <foo@example.com>, Real Name <bar@example.com>"'\r
++add_message '[to]="Nickname <foo@example.com>"' '[cc]="Real Name <Bar@Example.COM>"'\r
++add_message '[to]="Nickname <foo@example.com>"' '[bcc]="Real Name <Bar@Example.COM>"'\r
++\r
++test_begin_subtest "--output=recipients"\r
++notmuch search --output=recipients "*" >OUTPUT\r
++cat <<EOF >EXPECTED\r
++Real Name <foo@example.com>\r
++Real Name <bar@example.com>\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "--output=recipients --unique=none"\r
++notmuch search --output=recipients --unique=none "*" >OUTPUT\r
++cat <<EOF >EXPECTED\r
++Real Name <foo@example.com>\r
++Real Name <bar@example.com>\r
++Nickname <foo@example.com>\r
++Real Name <Bar@Example.COM>\r
++Nickname <foo@example.com>\r
++Real Name <Bar@Example.COM>\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "--output=recipients --unique=addr"\r
++notmuch search --output=recipients --unique=addr "*" >OUTPUT\r
++cat <<EOF >EXPECTED\r
++Real Name <foo@example.com>\r
++Real Name <bar@example.com>\r
++Real Name <Bar@Example.COM>\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "--output=recipients --unique=addrfold"\r
++notmuch search --output=recipients --unique=addrfold "*" >OUTPUT\r
++cat <<EOF >EXPECTED\r
++Real Name <foo@example.com>\r
++Real Name <bar@example.com>\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "--output=recipients --unique=name"\r
++notmuch search --output=recipients --unique=name "*" >OUTPUT\r
++cat <<EOF >EXPECTED\r
++Real Name <foo@example.com>\r
++Nickname <foo@example.com>\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "--output=recipients --unique=name,addrfold"\r
++notmuch search --output=recipients --unique=name,addrfold "*" >OUTPUT\r
++cat <<EOF >EXPECTED\r
++Real Name <foo@example.com>\r
++Real Name <bar@example.com>\r
++Nickname <foo@example.com>\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_done\r
+-- \r
+2.1.0\r
+\r