[PATCH v2 (rebased) 3/3] test: Update tests for 'authors_matched' and authors_non_matched'.
Mark Walters
markwalters1009 at gmail.com
Mon Dec 14 09:22:46 PST 2015
From: David Edmondson <dme at dme.org>
---
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 b346f37..3958841 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 800ebc6..6c71491 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 e256c10..66c2a1d 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.4
More information about the notmuch
mailing list