unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: Notmuch Mail <notmuch@notmuchmail.org>
Subject: [PATCH v2 2/2] Add additional munged reply-to tests
Date: Fri, 14 Jul 2017 22:14:23 +0200	[thread overview]
Message-ID: <20170714201423.19688-2-dkg@fifthhorseman.net> (raw)
In-Reply-To: <20170714201423.19688-1-dkg@fifthhorseman.net>

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).
---
 test/T220-reply.sh | 40 +++++++++++++++++++++++++++++++++++++++-
 1 file changed, 39 insertions(+), 1 deletion(-)

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>",
-- 
2.13.2

  reply	other threads:[~2017-07-14 20:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-14 13:09 [PATCH 1/2] Ensure that "notmuch reply" succeeds during testing Daniel Kahn Gillmor
2017-07-14 13:09 ` [PATCH 2/2] Add additional munged reply-to tests Daniel Kahn Gillmor
2017-07-14 13:26   ` Daniel Kahn Gillmor
2017-07-14 14:42 ` [PATCH 1/2] Ensure that "notmuch reply" succeeds during testing David Bremner
2017-07-14 17:08   ` Daniel Kahn Gillmor
2017-07-14 18:04     ` David Bremner
2017-07-14 20:14       ` [PATCH v2 " Daniel Kahn Gillmor
2017-07-14 20:14         ` Daniel Kahn Gillmor [this message]
2017-07-14 22:03           ` [PATCH] Avoid crashes in "notmuch reply" with gmime 3.0 when reply-to == sender Daniel Kahn Gillmor
2017-07-14 22:13             ` Daniel Kahn Gillmor
2017-07-14 22:53               ` Daniel Kahn Gillmor
2017-07-15 11:47                 ` David Bremner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170714201423.19688-2-dkg@fifthhorseman.net \
    --to=dkg@fifthhorseman.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).