[PATCH 3/3] test: add test for showing Reply-To headers
Peter Wang
novalazy at gmail.com
Sat Jun 23 20:27:50 PDT 2012
Test that show --format=text and --format=json now output
Reply-To headers when present.
---
test/json | 4 ++--
test/text | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/test/json b/test/json
index 6439788..0a692ac 100755
--- a/test/json
+++ b/test/json
@@ -3,9 +3,9 @@ test_description="--format=json output"
. ./test-lib.sh
test_begin_subtest "Show message: json"
-add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-show-message\""
+add_message "[subject]=\"json-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-show-message\"" "[reply-to]=\"json-show-reply-to\""
output=$(notmuch show --format=json "json-show-message")
-test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite <test_suite at notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite at notmuchmail.org>\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]"
+test_expect_equal "$output" "[[[{\"id\": \"${gen_msg_id}\", \"match\": true, \"excluded\": false, \"filename\": \"${gen_msg_filename}\", \"timestamp\": 946728000, \"date_relative\": \"2000-01-01\", \"tags\": [\"inbox\",\"unread\"], \"headers\": {\"Subject\": \"json-show-subject\", \"From\": \"Notmuch Test Suite <test_suite at notmuchmail.org>\", \"To\": \"Notmuch Test Suite <test_suite at notmuchmail.org>\", \"Reply-To\": \"json-show-reply-to\", \"Date\": \"Sat, 01 Jan 2000 12:00:00 +0000\"}, \"body\": [{\"id\": 1, \"content-type\": \"text/plain\", \"content\": \"json-show-message\n\"}]}, []]]]"
test_begin_subtest "Search message: json"
add_message "[subject]=\"json-search-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"json-search-message\""
diff --git a/test/text b/test/text
index 428c89b..bf1dfd1 100755
--- a/test/text
+++ b/test/text
@@ -3,7 +3,7 @@ test_description="--format=text output"
. ./test-lib.sh
test_begin_subtest "Show message: text"
-add_message "[subject]=\"text-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-show-message\""
+add_message "[subject]=\"text-show-subject\"" "[date]=\"Sat, 01 Jan 2000 12:00:00 -0000\"" "[body]=\"text-show-message\"" "[reply-to]=\"text-show-reply-to\""
output=$(notmuch show --format=text "text-show-message" | notmuch_show_sanitize_all)
test_expect_equal "$output" "\
message{ id:XXXXX depth:0 match:1 excluded:0 filename:XXXXX
@@ -12,6 +12,7 @@ Notmuch Test Suite <test_suite at notmuchmail.org> (2000-01-01) (inbox unread)
Subject: text-show-subject
From: Notmuch Test Suite <test_suite at notmuchmail.org>
To: Notmuch Test Suite <test_suite at notmuchmail.org>
+Reply-To: text-show-reply-to
Date: Sat, 01 Jan 2000 12:00:00 +0000
header}
body{
--
1.7.4.4
More information about the notmuch
mailing list