[PATCH 2/2] test: add tests for notmuch reply From guessing
Jani Nikula
jani at nikula.org
Fri May 11 07:32:23 PDT 2012
Add tests for picking up user's From address from fallback headers
Envelope-To, X-Original-To, and Delivered-To.
Signed-off-by: Jani Nikula <jani at nikula.org>
---
test/reply | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 55 insertions(+)
diff --git a/test/reply b/test/reply
index 00f4bea..ee5d361 100755
--- a/test/reply
+++ b/test/reply
@@ -138,4 +138,59 @@ References: <${gen_msg_id}>
On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite at notmuchmail.org> wrote:
> 200-byte header"
+
+test_begin_subtest "From guessing: Envelope-To"
+add_message '[from]="Sender <sender at example.com>"' \
+ '[to]="Recipient <recipient at example.com>"' \
+ '[subject]="From guessing"' \
+ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
+ '[body]="From guessing"' \
+ '[header]="Envelope-To: test_suite_other at notmuchmail.org"'
+
+output=$(notmuch reply id:${gen_msg_id})
+test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other at notmuchmail.org>
+Subject: Re: From guessing
+To: Sender <sender at example.com>, Recipient <recipient at example.com>
+In-Reply-To: <${gen_msg_id}>
+References: <${gen_msg_id}>
+
+On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender at example.com> wrote:
+> From guessing"
+
+test_begin_subtest "From guessing: X-Original-To"
+add_message '[from]="Sender <sender at example.com>"' \
+ '[to]="Recipient <recipient at example.com>"' \
+ '[subject]="From guessing"' \
+ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
+ '[body]="From guessing"' \
+ '[header]="X-Original-To: test_suite at otherdomain.org"'
+
+output=$(notmuch reply id:${gen_msg_id})
+test_expect_equal "$output" "From: Notmuch Test Suite <test_suite at otherdomain.org>
+Subject: Re: From guessing
+To: Sender <sender at example.com>, Recipient <recipient at example.com>
+In-Reply-To: <${gen_msg_id}>
+References: <${gen_msg_id}>
+
+On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender at example.com> wrote:
+> From guessing"
+
+test_begin_subtest "From guessing: Delivered-To"
+add_message '[from]="Sender <sender at example.com>"' \
+ '[to]="Recipient <recipient at example.com>"' \
+ '[subject]="From guessing"' \
+ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
+ '[body]="From guessing"' \
+ '[header]="Delivered-To: test_suite_other at notmuchmail.org"'
+
+output=$(notmuch reply id:${gen_msg_id})
+test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other at notmuchmail.org>
+Subject: Re: From guessing
+To: Sender <sender at example.com>, Recipient <recipient at example.com>
+In-Reply-To: <${gen_msg_id}>
+References: <${gen_msg_id}>
+
+On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender at example.com> wrote:
+> From guessing"
+
test_done
--
1.7.9.5
More information about the notmuch
mailing list