First a simple smoke test first, next generate messages with multiple
email address variants and check the behaviour of deduplication
schemes with these.

---

v2: more variation in name parts of email addresses
---
 test/T095-address.sh | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 74 insertions(+)

diff --git a/test/T095-address.sh b/test/T095-address.sh
index f8d902cb3a5e..a194faf3b842 100755
--- a/test/T095-address.sh
+++ b/test/T095-address.sh
@@ -215,4 +215,78 @@ [email protected]
 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)" <[email protected]>
+Adrian Perez de Castro <[email protected]>
+Alexander Botero-Lowry <[email protected]>
+Allan McRae <[email protected]>
+Aron Griffis <[email protected]>
+Carl Worth <[email protected]>
+Chris Wilson <[email protected]>
+François Boulogne <[email protected]>
+Ingmar Vanhassel <[email protected]>
+Israel Herraiz <[email protected]>
+Jan Janak <[email protected]>
+Jjgod Jiang <[email protected]>
+Keith Packard <[email protected]>
+Lars Kellogg-Stedman <[email protected]>
+Mikhail Gusarov <[email protected]>
+Olivier Berger <[email protected]>
+Rolland Santimano <[email protected]>
+Stewart Smith <[email protected]>
[email protected]
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+generate_message '[from]="Foo Bar <[email protected]>"'
+generate_message '[from]="Foo Bar <[email protected]>"'
+generate_message '[from]="Foo Bar <[email protected]>"'
+generate_message '[from]="Bar <[email protected]>"'
+generate_message '[from]="Foo <[email protected]>"'
+generate_message '[from]="<[email protected]>"'
+generate_message '[from]="[email protected]"'
+generate_message '[from]="Baz <[email protected]>"'
+generate_message '[from]="Foo Bar <[email protected]>"'
+generate_message '[from]="Baz <[email protected]>"'
+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
+Bar <[email protected]>
+Baz <[email protected]>
+Baz <[email protected]>
+Foo <[email protected]>
+Foo Bar <[email protected]>
+Foo Bar <[email protected]>
+Foo Bar <[email protected]>
+Foo Bar <[email protected]>
[email protected]
[email protected]
+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      Bar <[email protected]>
+1      Foo <[email protected]>
+1      Foo Bar <[email protected]>
+1      Foo Bar <[email protected]>
+2      Baz <[email protected]>
+2      Foo Bar <[email protected]>
+2      [email protected]
+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
+3      Baz <[email protected]>
+7      Foo Bar <[email protected]>
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
 test_done
-- 
2.1.4

_______________________________________________
notmuch mailing list
[email protected]
http://notmuchmail.org/mailman/listinfo/notmuch

Reply via email to