[PATCH v2 3/3] test: Update tests for 'authors_matched' and authors_non_matched'.
Mark Walters
markwalters1009 at gmail.com
Sun Jan 18 10:12:13 PST 2015
Hi
Only one small comment here: it would be nice to have a test that has a
non-empty authors_non_matched field.
Best wishes
Mark
On Fri, 24 Oct 2014, David Edmondson <dme at dme.org> wrote:
> ---
> test/T160-json.sh | 9 +++++++++
> test/T170-sexp.sh | 4 ++--
> test/T470-missing-headers.sh | 8 ++++++++
> 3 files changed, 19 insertions(+), 2 deletions(-)
>
> diff --git a/test/T160-json.sh b/test/T160-json.sh
> index c1cf649..0a8df18 100755
> --- a/test/T160-json.sh
> +++ b/test/T160-json.sh
> @@ -25,6 +25,10 @@ test_expect_equal_json "$output" "[{\"thread\": \"XXX\",
> \"matched\": 1,
> \"total\": 1,
> \"authors\": \"Notmuch Test Suite\",
> + \"authors_matched\": [
> + \"Notmuch Test Suite\"
> + ],
> + \"authors_non_matched\": [],
> \"subject\": \"json-search-subject\",
> \"query\": [\"id:$gen_msg_id\", null],
> \"tags\": [\"inbox\",
> @@ -59,6 +63,11 @@ test_expect_equal_json "$output" "[{\"thread\": \"XXX\",
> \"matched\": 1,
> \"total\": 1,
> \"authors\": \"Notmuch Test Suite\",
> + \"authors\": \"Notmuch Test Suite\",
> + \"authors_matched\": [
> + \"Notmuch Test Suite\"
> + ],
> + \"authors_non_matched\": [],
> \"subject\": \"json-search-utf8-body-sübjéct\",
> \"query\": [\"id:$gen_msg_id\", null],
> \"tags\": [\"inbox\",
> diff --git a/test/T170-sexp.sh b/test/T170-sexp.sh
> index 667e319..f2a08bf 100755
> --- a/test/T170-sexp.sh
> +++ b/test/T170-sexp.sh
> @@ -19,7 +19,7 @@ test_expect_equal "$output" "((((:id \"${gen_msg_id}\" :match t :excluded nil :f
> test_begin_subtest "Search message: sexp"
> add_message "[subject]=\"sexp-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"sexp-search-message\""
> output=$(notmuch search --format=sexp "sexp-search-message" | notmuch_search_sanitize)
> -test_expect_equal "$output" "((:thread \"0000000000000002\" :timestamp 946728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmuch Test Suite\" :subject \"sexp-search-subject\" :query (\"id:$gen_msg_id\" nil) :tags (\"inbox\" \"unread\")))"
> +test_expect_equal "$output" "((:thread \"0000000000000002\" :timestamp 946728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmuch Test Suite\" :authors_matched (\"Notmuch Test Suite\") :authors_non_matched () :subject \"sexp-search-subject\" :query (\"id:$gen_msg_id\" nil) :tags (\"inbox\" \"unread\")))"
>
> test_begin_subtest "Show message: sexp, utf-8"
> add_message "[subject]=\"sexp-show-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-show-méssage\""
> @@ -44,7 +44,7 @@ test_expect_equal "$output" "((((:id \"$id\" :match t :excluded nil :filename \"
> test_begin_subtest "Search message: sexp, utf-8"
> add_message "[subject]=\"sexp-search-utf8-body-sübjéct\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"jsön-search-méssage\""
> output=$(notmuch search --format=sexp "jsön-search-méssage" | notmuch_search_sanitize)
> -test_expect_equal "$output" "((:thread \"0000000000000005\" :timestamp 946728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmuch Test Suite\" :subject \"sexp-search-utf8-body-sübjéct\" :query (\"id:$gen_msg_id\" nil) :tags (\"inbox\" \"unread\")))"
> +test_expect_equal "$output" "((:thread \"0000000000000005\" :timestamp 946728000 :date_relative \"2000-01-01\" :matched 1 :total 1 :authors \"Notmuch Test Suite\" :authors_matched (\"Notmuch Test Suite\") :authors_non_matched () :subject \"sexp-search-utf8-body-sübjéct\" :query (\"id:$gen_msg_id\" nil) :tags (\"inbox\" \"unread\")))"
>
>
> test_done
> diff --git a/test/T470-missing-headers.sh b/test/T470-missing-headers.sh
> index cb38301..250a370 100755
> --- a/test/T470-missing-headers.sh
> +++ b/test/T470-missing-headers.sh
> @@ -34,6 +34,10 @@ test_expect_equal_json "$output" '
> [
> {
> "authors": "",
> + "authors_matched": [
> + ""
> + ],
> + "authors_non_matched": [],
> "date_relative": "2001-01-05",
> "matched": 1,
> "subject": "",
> @@ -48,6 +52,10 @@ test_expect_equal_json "$output" '
> },
> {
> "authors": "Notmuch Test Suite",
> + "authors_matched": [
> + "Notmuch Test Suite"
> + ],
> + "authors_non_matched": [],
> "date_relative": "1970-01-01",
> "matched": 1,
> "subject": "",
> --
> 2.1.1
>
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
More information about the notmuch
mailing list