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 <<EOF >EXPECTED
+"Discussion about the Arch User Repository (AUR)" <aur-gene...@archlinux.org>
+Adrian Perez de Castro <ape...@igalia.com>
+Alexander Botero-Lowry <alex.boterolo...@gmail.com>
+Allan McRae <al...@archlinux.org>
+Aron Griffis <agrif...@n01se.net>
+Carl Worth <cwo...@cworth.org>
+Chris Wilson <ch...@chris-wilson.co.uk>
+François Boulogne <boulogn...@gmail.com>
+Ingmar Vanhassel <ing...@exherbo.org>
+Israel Herraiz <i...@herraiz.org>
+Jan Janak <j...@ryngle.com>
+Jjgod Jiang <gzjj...@gmail.com>
+Keith Packard <kei...@keithp.com>
+Lars Kellogg-Stedman <l...@seas.harvard.edu>
+Mikhail Gusarov <dotted...@dottedmag.net>
+Olivier Berger <olivier.ber...@it-sudparis.eu>
+Rolland Santimano <rollandsantim...@yahoo.com>
+Stewart Smith <stew...@flamingspork.com>
+notmuch@notmuchmail.org
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+generate_message '[from]="Foo Bar <foo....@example.com>"'
+generate_message '[from]="Foo Bar <foo....@example.com>"'
+generate_message '[from]="Foo Bar <foo....@example.com>"'
+generate_message '[from]="<foo....@example.com>"'
+generate_message '[from]="foo....@example.com"'
+generate_message '[from]="Foo Bar <foo.bar+...@example.com>"'
+notmuch new > /dev/null
+
+test_begin_subtest "--deduplicate=no --output=sender"
+notmuch address --deduplicate=no --output=sender from:example.com | sort 
>OUTPUT
+cat <<EOF >EXPECTED
+Foo Bar <foo....@example.com>
+Foo Bar <foo.bar+...@example.com>
+Foo Bar <foo....@example.com>
+Foo Bar <foo....@example.com>
+foo....@example.com
+foo....@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 <<EOF >EXPECTED
+1      Foo Bar <foo....@example.com>
+1      Foo Bar <foo.bar+...@example.com>
+2      Foo Bar <foo....@example.com>
+2      foo....@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 <<EOF >EXPECTED
+1      Foo Bar <foo.bar+...@example.com>
+5      Foo Bar <foo....@example.com>
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
 test_done
-- 
2.1.4

_______________________________________________
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to