From: Jani Nikula Date: Fri, 25 Sep 2015 17:08:09 +0000 (+0300) Subject: test: add notmuch address --deduplicate=(no|mailbox|address) tests X-Git-Tag: 0.21_rc0~25 X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=commitdiff_plain;h=f99872418228e6488e07f343ee07845a251852bf;ds=sidebyside test: add notmuch address --deduplicate=(no|mailbox|address) tests First a simple smoke test first, next generate messages with multiple email address variants and check the behaviour of deduplication schemes with these. --- diff --git a/test/T095-address.sh b/test/T095-address.sh index f8d902cb..a194faf3 100755 --- a/test/T095-address.sh +++ b/test/T095-address.sh @@ -215,4 +215,78 @@ 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]="Bar "' +generate_message '[from]="Foo "' +generate_message '[from]=""' +generate_message '[from]="foo.bar@example.com"' +generate_message '[from]="Baz "' +generate_message '[from]="Foo Bar "' +generate_message '[from]="Baz "' +notmuch new > /dev/null + +test_begin_subtest "--deduplicate=no --output=sender" +notmuch address --deduplicate=no --output=sender from:example.com | sort >OUTPUT +cat <EXPECTED +Bar +Baz +Baz +Foo +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 Bar +1 Foo +1 Foo Bar +1 Foo Bar +2 Baz +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 +3 Baz +7 Foo Bar +EOF +test_expect_equal_file OUTPUT EXPECTED + test_done