[PATCH 7½/9] test: add notmuch address --deduplicate=(no|mailbox|address) tests
Jani Nikula
jani at nikula.org
Fri Sep 4 11:38:47 PDT 2015
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 at 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-general at archlinux.org>
+Adrian Perez de Castro <aperez at igalia.com>
+Alexander Botero-Lowry <alex.boterolowry at gmail.com>
+Allan McRae <allan at archlinux.org>
+Aron Griffis <agriffis at n01se.net>
+Carl Worth <cworth at cworth.org>
+Chris Wilson <chris at chris-wilson.co.uk>
+François Boulogne <boulogne.f at gmail.com>
+Ingmar Vanhassel <ingmar at exherbo.org>
+Israel Herraiz <isra at herraiz.org>
+Jan Janak <jan at ryngle.com>
+Jjgod Jiang <gzjjgod at gmail.com>
+Keith Packard <keithp at keithp.com>
+Lars Kellogg-Stedman <lars at seas.harvard.edu>
+Mikhail Gusarov <dottedmag at dottedmag.net>
+Olivier Berger <olivier.berger at it-sudparis.eu>
+Rolland Santimano <rollandsantimano at yahoo.com>
+Stewart Smith <stewart at flamingspork.com>
+notmuch at notmuchmail.org
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+generate_message '[from]="Foo Bar <foo.bar at example.com>"'
+generate_message '[from]="Foo Bar <Foo.Bar at Example.Com>"'
+generate_message '[from]="Foo Bar <foo.bar at example.com>"'
+generate_message '[from]="<foo.bar at example.com>"'
+generate_message '[from]="foo.bar at example.com"'
+generate_message '[from]="Foo Bar <foo.bar+baz at 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.Bar at Example.Com>
+Foo Bar <foo.bar+baz at example.com>
+Foo Bar <foo.bar at example.com>
+Foo Bar <foo.bar at example.com>
+foo.bar at example.com
+foo.bar at 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.Bar at Example.Com>
+1 Foo Bar <foo.bar+baz at example.com>
+2 Foo Bar <foo.bar at example.com>
+2 foo.bar at 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+baz at example.com>
+5 Foo Bar <foo.bar at example.com>
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
test_done
--
2.1.4
More information about the notmuch
mailing list