X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT095-address.sh;h=817be5380a45d9a98a7a6bbd2031269575dd13ba;hp=a194faf3b8425ec5bd8eabcee59b7637cd82e813;hb=f33053023b2a3f42ba7d87e3ed58b58673bf08ad;hpb=33c8777a967ece2dd4bbda7e83a4e07c195abf51 diff --git a/test/T095-address.sh b/test/T095-address.sh index a194faf3..817be538 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,43 @@ 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=recipients --output=address" +notmuch address --output=recipients --output=address '*' >OUTPUT +cat <EXPECTED +allan@archlinux.org +aur-general@archlinux.org +olivier.berger@it-sudparis.eu +notmuch@notmuchmail.org +notmuch@notmuchmail.org +keithp@keithp.com +dottedmag@dottedmag.net +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_begin_subtest "--output=sender --output=address --output=count" +notmuch address --output=sender --output=address --output=count '*' | sort -n >OUTPUT +cat <EXPECTED +1 agriffis@n01se.net +1 aperez@igalia.com +1 boulogne.f@gmail.com +1 chris@chris-wilson.co.uk +1 ingmar@exherbo.org +1 isra@herraiz.org +1 olivier.berger@it-sudparis.eu +1 rollandsantimano@yahoo.com +2 alex.boterolowry@gmail.com +2 gzjjgod@gmail.com +3 stewart@flamingspork.com +4 alex.boterolowry@gmail.com +4 jan@ryngle.com +5 dottedmag@dottedmag.net +5 lars@seas.harvard.edu +7 keithp@keithp.com +12 cworth@cworth.org +EOF +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 +179,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 +237,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,7 +249,7 @@ 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 @@ -238,7 +274,7 @@ Rolland Santimano Stewart Smith notmuch@notmuchmail.org EOF -test_expect_equal_file OUTPUT EXPECTED +test_expect_equal_file EXPECTED OUTPUT generate_message '[from]="Foo Bar "' generate_message '[from]="Foo Bar "' @@ -266,7 +302,7 @@ Foo Bar foo.bar@example.com foo.bar@example.com EOF -test_expect_equal_file OUTPUT EXPECTED +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 @@ -279,7 +315,7 @@ cat <EXPECTED 2 Foo Bar 2 foo.bar@example.com EOF -test_expect_equal_file OUTPUT EXPECTED +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 @@ -287,6 +323,6 @@ cat <EXPECTED 3 Baz 7 Foo Bar EOF -test_expect_equal_file OUTPUT EXPECTED +test_expect_equal_file EXPECTED OUTPUT test_done