X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2FT095-address.sh;h=f8d902cb3a5e2f63ad7e2f02d0cb079691b52e08;hp=033d0f4fd68cffbae01e2473af5b08924239172f;hb=adba9b0d50d3aae55e5a2713c4d760d203c20a54;hpb=a5a6859197fb0b9cea7d75c4ec9377b9fc7d7285 diff --git a/test/T095-address.sh b/test/T095-address.sh index 033d0f4f..f8d902cb 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 +. ./test-lib.sh || exit 1 add_email_corpus @@ -27,6 +27,11 @@ Mikhail Gusarov EOF test_expect_equal_file OUTPUT EXPECTED +test_begin_subtest "without --output" +notmuch address '*' >OUTPUT +# Use EXPECTED from previous subtest +test_expect_equal_file OUTPUT EXPECTED + test_begin_subtest "--output=sender --format=json" notmuch address --output=sender --format=json '*' >OUTPUT cat <EXPECTED @@ -91,11 +96,6 @@ Mikhail Gusarov EOF test_expect_equal_file OUTPUT EXPECTED -test_begin_subtest "without --output" -notmuch address '*' >OUTPUT -# Use EXPECTED from previous subtest -test_expect_equal_file OUTPUT EXPECTED - test_begin_subtest "--output=sender --output=count" notmuch address --output=sender --output=count '*' | sort -n >OUTPUT cat <EXPECTED @@ -119,10 +119,10 @@ cat <EXPECTED EOF test_expect_equal_file OUTPUT EXPECTED -test_begin_subtest "--output=sender --output=count --format=json" +test_begin_subtest "--output=count --format=json" # Since the iteration order of GHashTable is not specified, we # preprocess and sort the results to keep the order stable here. -notmuch address --output=sender --output=count --format=json '*' | \ +notmuch address --output=count --format=json '*' | \ sed -e 's/^\[//' -e 's/]$//' -e 's/,$//' | sort >OUTPUT cat <EXPECTED {"name": "Adrian Perez de Castro", "address": "aperez@igalia.com", "name-addr": "Adrian Perez de Castro ", "count": 1} @@ -145,4 +145,74 @@ cat <EXPECTED EOF test_expect_equal_file OUTPUT EXPECTED +test_begin_subtest "--deduplicate=no --sort=oldest-first --output=sender" +notmuch address --deduplicate=no --sort=oldest-first --output=sender '*' >OUTPUT +cat <EXPECTED +Mikhail Gusarov +Mikhail Gusarov +Carl Worth +Lars Kellogg-Stedman +Mikhail Gusarov +Alex Botero-Lowry +Carl Worth +Lars Kellogg-Stedman +Mikhail Gusarov +Mikhail Gusarov +Keith Packard +Keith Packard +Keith Packard +Jan Janak +Jan Janak +Jan Janak +Israel Herraiz +Adrian Perez de Castro +Aron Griffis +Ingmar Vanhassel +Alex Botero-Lowry +Lars Kellogg-Stedman +Lars Kellogg-Stedman +Lars Kellogg-Stedman +Stewart Smith +Stewart Smith +Keith Packard +Keith Packard +Keith Packard +Stewart Smith +Jjgod Jiang +Jan Janak +Rolland Santimano +Alexander Botero-Lowry +Jjgod Jiang +Alexander Botero-Lowry +Alexander Botero-Lowry +Keith Packard +Alexander Botero-Lowry +Carl Worth +Carl Worth +Carl Worth +Carl Worth +Carl Worth +Carl Worth +Carl Worth +Carl Worth +Carl Worth +Carl Worth +Chris Wilson +Olivier Berger +François Boulogne +EOF +test_expect_equal_file OUTPUT EXPECTED + +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 +cat <EXPECTED +Mikhail Gusarov +notmuch@notmuchmail.org +Mikhail Gusarov +notmuch@notmuchmail.org +Lars Kellogg-Stedman +notmuch@notmuchmail.org +EOF +test_expect_equal_file OUTPUT EXPECTED + test_done