---
 test/T090-search-output.sh | 59 +++++++++++++++++++++++++++++++++++++++++++
 test/T095-search-unique.sh | 63 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 122 insertions(+)
 create mode 100755 test/T095-search-unique.sh

diff --git a/test/T090-search-output.sh b/test/T090-search-output.sh
index 947d572..ebc8c37 100755
--- a/test/T090-search-output.sh
+++ b/test/T090-search-output.sh
@@ -387,6 +387,65 @@ cat <<EOF >EXPECTED
 EOF
 test_expect_equal_file OUTPUT EXPECTED
 
+test_begin_subtest "--output=sender"
+notmuch search --output=sender '*' | sort >OUTPUT
+cat <<EOF >EXPECTED
+Adrian Perez de Castro <[email protected]>
+Alexander Botero-Lowry <[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]>
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+test_begin_subtest "--output=recipients"
+notmuch search --output=recipients '*' | sort >OUTPUT
+cat <<EOF >EXPECTED
+Allan McRae <[email protected]>
+Discussion about the Arch User Repository (AUR) <[email protected]>
+Keith Packard <[email protected]>
+Mikhail Gusarov <[email protected]>
[email protected]
[email protected]
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+test_begin_subtest "--output=addresses"
+notmuch search --output=addresses '*' | sort >OUTPUT
+cat <<EOF >EXPECTED
+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]>
+Discussion about the Arch User Repository (AUR) <[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
+
 test_begin_subtest "sanitize output for quoted-printable line-breaks in author 
and subject"
 add_message "[subject]='two =?ISO-8859-1?Q?line=0A_subject?=
        headers'"
diff --git a/test/T095-search-unique.sh b/test/T095-search-unique.sh
new file mode 100755
index 0000000..8fd8fc0
--- /dev/null
+++ b/test/T095-search-unique.sh
@@ -0,0 +1,63 @@
+#!/usr/bin/env bash
+test_description='address deduplication in "notmuch search --output=addresses"'
+. ./test-lib.sh
+
+add_message '[to]="Real Name <[email protected]>, Real Name <[email protected]>"'
+add_message '[to]="Nickname <[email protected]>"' '[cc]="Real Name 
<[email protected]>"'
+add_message '[to]="Nickname <[email protected]>"' '[bcc]="Real Name 
<[email protected]>"'
+
+test_begin_subtest "--output=recipients"
+notmuch search --output=recipients "*" >OUTPUT
+cat <<EOF >EXPECTED
+Real Name <[email protected]>
+Real Name <[email protected]>
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+test_begin_subtest "--output=recipients --unique=none"
+notmuch search --output=recipients --unique=none "*" >OUTPUT
+cat <<EOF >EXPECTED
+Real Name <[email protected]>
+Real Name <[email protected]>
+Nickname <[email protected]>
+Real Name <[email protected]>
+Nickname <[email protected]>
+Real Name <[email protected]>
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+test_begin_subtest "--output=recipients --unique=addr"
+notmuch search --output=recipients --unique=addr "*" >OUTPUT
+cat <<EOF >EXPECTED
+Real Name <[email protected]>
+Real Name <[email protected]>
+Real Name <[email protected]>
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+test_begin_subtest "--output=recipients --unique=addrfold"
+notmuch search --output=recipients --unique=addrfold "*" >OUTPUT
+cat <<EOF >EXPECTED
+Real Name <[email protected]>
+Real Name <[email protected]>
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+test_begin_subtest "--output=recipients --unique=name"
+notmuch search --output=recipients --unique=name "*" >OUTPUT
+cat <<EOF >EXPECTED
+Real Name <[email protected]>
+Nickname <[email protected]>
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+test_begin_subtest "--output=recipients --unique=name,addrfold"
+notmuch search --output=recipients --unique=name,addrfold "*" >OUTPUT
+cat <<EOF >EXPECTED
+Real Name <[email protected]>
+Real Name <[email protected]>
+Nickname <[email protected]>
+EOF
+test_expect_equal_file OUTPUT EXPECTED
+
+test_done
-- 
2.1.0

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

Reply via email to