Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 156E8431FD0 for ; Mon, 22 Sep 2014 02:39:36 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 55k0x0Bi82cQ for ; Mon, 22 Sep 2014 02:39:28 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id BDF21431FAE for ; Mon, 22 Sep 2014 02:39:27 -0700 (PDT) Received: from localhost (unknown [192.168.200.7]) by max.feld.cvut.cz (Postfix) with ESMTP id 245123CFEA8; Mon, 22 Sep 2014 11:39:26 +0200 (CEST) X-Virus-Scanned: IMAP STYX AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new, port 10044) with ESMTP id 8sAr8mFNSNEe; Mon, 22 Sep 2014 11:39:22 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id C26EC5CCE67; Mon, 22 Sep 2014 11:39:22 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.84) (envelope-from ) id 1XW05U-0001we-Qo; Mon, 22 Sep 2014 11:39:16 +0200 From: Michal Sojka To: notmuch@notmuchmail.org Subject: [PATCH 5/5] cli: Add tests for 'search --output=addresses' and similar Date: Mon, 22 Sep 2014 11:37:59 +0200 Message-Id: <1411378679-7307-6-git-send-email-sojkam1@fel.cvut.cz> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1411378679-7307-1-git-send-email-sojkam1@fel.cvut.cz> References: <1411378679-7307-1-git-send-email-sojkam1@fel.cvut.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 09:39:36 -0000 --- test/T090-search-output.sh | 59 +++++++++++++++++++++++++++++++++++++++++++ test/T095-search-unique.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) create mode 100755 test/T095-search-unique.sh diff --git a/test/T090-search-output.sh b/test/T090-search-output.sh index 947d572..ebc8c37 100755 --- a/test/T090-search-output.sh +++ b/test/T090-search-output.sh @@ -387,6 +387,65 @@ cat <EXPECTED EOF test_expect_equal_file OUTPUT EXPECTED +test_begin_subtest "--output=sender" +notmuch search --output=sender '*' | sort >OUTPUT +cat <EXPECTED +Adrian Perez de Castro +Alexander Botero-Lowry +Aron Griffis +Carl Worth +Chris Wilson +François Boulogne +Ingmar Vanhassel +Israel Herraiz +Jan Janak +Jjgod Jiang +Keith Packard +Lars Kellogg-Stedman +Mikhail Gusarov +Olivier Berger +Rolland Santimano +Stewart Smith +EOF +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "--output=recipients" +notmuch search --output=recipients '*' | sort >OUTPUT +cat <EXPECTED +Allan McRae +Discussion about the Arch User Repository (AUR) +Keith Packard +Mikhail Gusarov +notmuch@notmuchmail.org +olivier.berger@it-sudparis.eu +EOF +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "--output=addresses" +notmuch search --output=addresses '*' | sort >OUTPUT +cat <EXPECTED +Adrian Perez de Castro +Alexander Botero-Lowry +Allan McRae +Aron Griffis +Carl Worth +Chris Wilson +Discussion about the Arch User Repository (AUR) +François Boulogne +Ingmar Vanhassel +Israel Herraiz +Jan Janak +Jjgod Jiang +Keith Packard +Lars Kellogg-Stedman +Mikhail Gusarov +Olivier Berger +Rolland Santimano +Stewart Smith +notmuch@notmuchmail.org +EOF +test_expect_equal_file OUTPUT EXPECTED + test_begin_subtest "sanitize output for quoted-printable line-breaks in author and subject" add_message "[subject]='two =?ISO-8859-1?Q?line=0A_subject?= headers'" diff --git a/test/T095-search-unique.sh b/test/T095-search-unique.sh new file mode 100755 index 0000000..8fd8fc0 --- /dev/null +++ b/test/T095-search-unique.sh @@ -0,0 +1,63 @@ +#!/usr/bin/env bash +test_description='address deduplication in "notmuch search --output=addresses"' +. ./test-lib.sh + +add_message '[to]="Real Name , Real Name "' +add_message '[to]="Nickname "' '[cc]="Real Name "' +add_message '[to]="Nickname "' '[bcc]="Real Name "' + +test_begin_subtest "--output=recipients" +notmuch search --output=recipients "*" >OUTPUT +cat <EXPECTED +Real Name +Real Name +EOF +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "--output=recipients --unique=none" +notmuch search --output=recipients --unique=none "*" >OUTPUT +cat <EXPECTED +Real Name +Real Name +Nickname +Real Name +Nickname +Real Name +EOF +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "--output=recipients --unique=addr" +notmuch search --output=recipients --unique=addr "*" >OUTPUT +cat <EXPECTED +Real Name +Real Name +Real Name +EOF +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "--output=recipients --unique=addrfold" +notmuch search --output=recipients --unique=addrfold "*" >OUTPUT +cat <EXPECTED +Real Name +Real Name +EOF +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "--output=recipients --unique=name" +notmuch search --output=recipients --unique=name "*" >OUTPUT +cat <EXPECTED +Real Name +Nickname +EOF +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "--output=recipients --unique=name,addrfold" +notmuch search --output=recipients --unique=name,addrfold "*" >OUTPUT +cat <EXPECTED +Real Name +Real Name +Nickname +EOF +test_expect_equal_file OUTPUT EXPECTED + +test_done -- 2.1.0