X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=test%2FT095-address.sh;h=f0291d29ec43076a3fda9f41ffadb6a6aed2ef43;hb=c5356b9ed56e42d36ca18206155b62c94cfbd79d;hp=f8d902cb3a5e2f63ad7e2f02d0cb079691b52e08;hpb=adba9b0d50d3aae55e5a2713c4d760d203c20a54;p=notmuch diff --git a/test/T095-address.sh b/test/T095-address.sh index f8d902cb..f0291d29 100755 --- a/test/T095-address.sh +++ b/test/T095-address.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash test_description='"notmuch address" in several variants' -. ./test-lib.sh || exit 1 +. $(dirname "$0")/test-lib.sh || exit 1 add_email_corpus @@ -25,12 +25,12 @@ Adrian Perez de Castro Israel Herraiz Mikhail Gusarov EOF -test_expect_equal_file OUTPUT EXPECTED +test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "without --output" notmuch address '*' >OUTPUT # Use EXPECTED from previous subtest -test_expect_equal_file OUTPUT EXPECTED +test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "--output=sender --format=json" notmuch address --output=sender --format=json '*' >OUTPUT @@ -53,7 +53,7 @@ cat <EXPECTED {"name": "Israel Herraiz", "address": "isra@herraiz.org", "name-addr": "Israel Herraiz "}, {"name": "Mikhail Gusarov", "address": "dottedmag@dottedmag.net", "name-addr": "Mikhail Gusarov "}] EOF -test_expect_equal_file OUTPUT EXPECTED +test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "--output=recipients" notmuch address --output=recipients '*' >OUTPUT @@ -66,7 +66,7 @@ notmuch Keith Packard Mikhail Gusarov EOF -test_expect_equal_file OUTPUT EXPECTED +test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "--output=sender --output=recipients" notmuch address --output=sender --output=recipients '*' >OUTPUT @@ -94,7 +94,7 @@ Adrian Perez de Castro Israel Herraiz Mikhail Gusarov EOF -test_expect_equal_file OUTPUT EXPECTED +test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "--output=sender --output=count" notmuch address --output=sender --output=count '*' | sort -n >OUTPUT @@ -117,7 +117,7 @@ cat <EXPECTED 7 Keith Packard 12 Carl Worth EOF -test_expect_equal_file OUTPUT EXPECTED +test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "--output=count --format=json" # Since the iteration order of GHashTable is not specified, we @@ -143,7 +143,7 @@ cat <EXPECTED {"name": "Rolland Santimano", "address": "rollandsantimano@yahoo.com", "name-addr": "Rolland Santimano ", "count": 1} {"name": "Stewart Smith", "address": "stewart@flamingspork.com", "name-addr": "Stewart Smith ", "count": 3} EOF -test_expect_equal_file OUTPUT EXPECTED +test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "--deduplicate=no --sort=oldest-first --output=sender" notmuch address --deduplicate=no --sort=oldest-first --output=sender '*' >OUTPUT @@ -201,7 +201,7 @@ Chris Wilson Olivier Berger François Boulogne EOF -test_expect_equal_file OUTPUT EXPECTED +test_expect_equal_file EXPECTED OUTPUT test_begin_subtest "--deduplicate=no --sort=newest-first --output=sender --output=recipients" notmuch address --deduplicate=no --sort=newest-first --output=sender --output=recipients path:foo/new >OUTPUT @@ -213,6 +213,80 @@ notmuch@notmuchmail.org Lars Kellogg-Stedman notmuch@notmuchmail.org EOF -test_expect_equal_file OUTPUT EXPECTED +test_expect_equal_file EXPECTED OUTPUT + +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 EXPECTED OUTPUT + +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 EXPECTED OUTPUT + +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 EXPECTED OUTPUT + +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 EXPECTED OUTPUT test_done