summaryrefslogtreecommitdiffstats
path: root/test/T220-reply.sh
diff options
context:
space:
mode:
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>2017-07-14 22:14:23 +0200
committerDavid Bremner <david@tethera.net>2017-07-14 21:23:52 -0300
commit8492298a613e8e666d0f3054dadcb98b72a65ae4 (patch)
tree44e2e02430fbb9bbd125bda2c2875f8a45243a80 /test/T220-reply.sh
parent23a4d09773ebdb8b3b5d45b6fa5196190228f52d (diff)
Add additional munged reply-to tests
The reply-to munging code might behave differently whether there's an exact match on the strings or not, or whether the string is a raw addr-spec instead of an name-addr. These tests cover those variations (i also had to tweak json output further below when this new test was added).
Diffstat (limited to 'test/T220-reply.sh')
-rwxr-xr-xtest/T220-reply.sh40
1 files changed, 39 insertions, 1 deletions
diff --git a/test/T220-reply.sh b/test/T220-reply.sh
index c29a900f..4fb67ffb 100755
--- a/test/T220-reply.sh
+++ b/test/T220-reply.sh
@@ -133,6 +133,44 @@ On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
> Un-munging Reply-To
OK"
+test_begin_subtest "Un-munging Reply-To With Exact Match"
+add_message '[from]="Sender <sender@example.com>"' \
+ '[to]="Some List <list@example.com>"' \
+ [subject]=notmuch-reply-test \
+ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
+ '[body]="Un-munging Reply-To"' \
+ '[reply-to]="Some List <list@example.com>"'
+
+output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK)
+test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
+Subject: Re: notmuch-reply-test
+To: Sender <sender@example.com>, Some List <list@example.com>
+In-Reply-To: <${gen_msg_id}>
+References: <${gen_msg_id}>
+
+On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
+> Un-munging Reply-To
+OK"
+
+test_begin_subtest "Un-munging Reply-To With Raw addr-spec"
+add_message '[from]="Sender <sender@example.com>"' \
+ '[to]="Some List <list@example.com>"' \
+ [subject]=notmuch-reply-test \
+ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
+ '[body]="Un-munging Reply-To"' \
+ '[reply-to]="list@example.com"'
+
+output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK)
+test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
+Subject: Re: notmuch-reply-test
+To: Sender <sender@example.com>, Some List <list@example.com>
+In-Reply-To: <${gen_msg_id}>
+References: <${gen_msg_id}>
+
+On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
+> Un-munging Reply-To
+OK"
+
test_begin_subtest "Message with header of exactly 200 bytes"
add_message '[subject]="This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces"' \
'[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
@@ -241,7 +279,7 @@ test_expect_equal_json "$output" '
],
"date_relative": "2010-01-05",
"excluded": false,
- "filename": ["'${MAIL_DIR}'/msg-012"],
+ "filename": ["'${MAIL_DIR}'/msg-014"],
"headers": {
"Date": "Tue, 05 Jan 2010 15:43:56 +0000",
"From": "\u2603 <snowman@example.com>",