Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 350A96DE14C7 for ; Fri, 4 Sep 2015 11:38:56 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.486 X-Spam-Level: X-Spam-Status: No, score=-0.486 tagged_above=-999 required=5 tests=[AWL=0.234, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MtBB38AOzSNM for ; Fri, 4 Sep 2015 11:38:54 -0700 (PDT) Received: from mail-wi0-f178.google.com (mail-wi0-f178.google.com [209.85.212.178]) by arlo.cworth.org (Postfix) with ESMTPS id 8EE526DE147C for ; Fri, 4 Sep 2015 11:38:53 -0700 (PDT) Received: by wiclk2 with SMTP id lk2so31284169wic.0 for ; Fri, 04 Sep 2015 11:38:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=Ju/Ncdqhmquj9ib+DrTINAS4qgBoo0T/Ts5DB6fnldA=; b=cMkWs+cpKYjpp0UdT6e560Q50zDhgG0EtMI2iePD7ZA7V8tfGzdJqUnz6zgWGzk+HL GyYEi6CKOSwPnY3k1N/JKKSOKvXHNG1m8phec/qFwn7PeosVoLCAQQX5QLANtGR3Tqgi 1ZX+Tcib+Y3bDQQP7KTcbsj1rcc5y4NJj3jcuwCIIqMH9ekAYauO3kW6eLLloVj6mf5s Vldiktk4dR81KSMzqGP5y1MQAkD8vJEX8pD/jZJTCesIdU2VOVKS908Gv/gj9gGr0obW wVqa22EqKLWT0aIZmGn1YUWCMezZXGpnQInshr5u2U1X2lz0MjibIkTB8n10/OxSasbM EFyA== X-Gm-Message-State: ALoCoQknjKwZNFHH+baHQdZBDUzxacMnjh+lmLjtT5Bm5b69732wdYbMbpTCZaVyoXX9+FTbEMTl X-Received: by 10.194.59.100 with SMTP id y4mr10119771wjq.151.1441391932079; Fri, 04 Sep 2015 11:38:52 -0700 (PDT) Received: from localhost (mobile-access-bcee4f-131.dhcp.inet.fi. [188.238.79.131]) by smtp.gmail.com with ESMTPSA id cx3sm4845495wjc.27.2015.09.04.11.38.51 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 04 Sep 2015 11:38:51 -0700 (PDT) From: Jani Nikula To: Jani Nikula , notmuch@notmuchmail.org Subject: =?utf-8?q?=5BPATCH_7=C2=BD/9=5D_test=3A_add_notmuch_address_--deduplicate=3D=28no=7Cmailbox=7Caddress=29_tests?= Date: Fri, 4 Sep 2015 21:38:47 +0300 Message-Id: <1441391927-18228-1-git-send-email-jani@nikula.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: 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.18 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: Fri, 04 Sep 2015 18:38:56 -0000 First a simple smoke test first, next generate messages with multiple email address variants and check the behaviour of deduplication schemes with these. --- test/T095-address.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/test/T095-address.sh b/test/T095-address.sh index f8d902cb3a5e..54ac713a5227 100755 --- a/test/T095-address.sh +++ b/test/T095-address.sh @@ -215,4 +215,67 @@ notmuch@notmuchmail.org EOF test_expect_equal_file OUTPUT EXPECTED +test_begin_subtest "--deduplicate=address --output=sender --output=recipients" +notmuch address --deduplicate=address --output=sender --output=recipients '*' | sort >OUTPUT +cat <EXPECTED +"Discussion about the Arch User Repository (AUR)" +Adrian Perez de Castro +Alexander Botero-Lowry +Allan McRae +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 +notmuch@notmuchmail.org +EOF +test_expect_equal_file OUTPUT EXPECTED + +generate_message '[from]="Foo Bar "' +generate_message '[from]="Foo Bar "' +generate_message '[from]="Foo Bar "' +generate_message '[from]=""' +generate_message '[from]="foo.bar@example.com"' +generate_message '[from]="Foo Bar "' +notmuch new > /dev/null + +test_begin_subtest "--deduplicate=no --output=sender" +notmuch address --deduplicate=no --output=sender from:example.com | sort >OUTPUT +cat <EXPECTED +Foo Bar +Foo Bar +Foo Bar +Foo Bar +foo.bar@example.com +foo.bar@example.com +EOF +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "--deduplicate=mailbox --output=sender --output=count" +notmuch address --deduplicate=mailbox --output=sender --output=count from:example.com | sort -n >OUTPUT +cat <EXPECTED +1 Foo Bar +1 Foo Bar +2 Foo Bar +2 foo.bar@example.com +EOF +test_expect_equal_file OUTPUT EXPECTED + +test_begin_subtest "--deduplicate=address --output=sender --output=count" +notmuch address --deduplicate=address --output=sender --output=count from:example.com | sort -n >OUTPUT +cat <EXPECTED +1 Foo Bar +5 Foo Bar +EOF +test_expect_equal_file OUTPUT EXPECTED + test_done -- 2.1.4