From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id D3DFB6DE17B1 for ; Fri, 14 Jul 2017 06:09:20 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[AWL=0.000] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 5b6c2d8T1vQf for ; Fri, 14 Jul 2017 06:09:19 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTP id 5AFCD6DE18A0 for ; Fri, 14 Jul 2017 06:09:19 -0700 (PDT) Received: from fifthhorseman.net (38.200.broadband6.iol.cz [88.101.200.38]) by che.mayfirst.org (Postfix) with ESMTPSA id 2E893F99B for ; Fri, 14 Jul 2017 09:09:17 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 10CF520161; Fri, 14 Jul 2017 15:09:12 +0200 (CEST) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH 2/2] Add additional munged reply-to tests Date: Fri, 14 Jul 2017 15:09:12 +0200 Message-Id: <20170714130912.24777-2-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170714130912.24777-1-dkg@fifthhorseman.net> References: <20170714130912.24777-1-dkg@fifthhorseman.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 Jul 2017 13:09:21 -0000 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 | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/test/T220-reply.sh b/test/T220-reply.sh index b12109bf..7da16583 100755 --- a/test/T220-reply.sh +++ b/test/T220-reply.sh @@ -126,6 +126,42 @@ References: <${gen_msg_id}> On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: > Un-munging Reply-To" +test_begin_subtest "Un-munging Reply-To With Exact Match" +add_message '[from]="Sender "' \ + '[to]="Some List "' \ + [subject]=notmuch-reply-test \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="Un-munging Reply-To"' \ + '[reply-to]="Some List "' + +output=$(notmuch reply id:${gen_msg_id} || echo failed) +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: notmuch-reply-test +To: Sender , Some List +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> Un-munging Reply-To" + +test_begin_subtest "Un-munging Reply-To With Raw addr-spec" +add_message '[from]="Sender "' \ + '[to]="Some List "' \ + [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} || echo failed) +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: notmuch-reply-test +To: Sender , Some List +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> Un-munging Reply-To" + 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"' \ @@ -229,7 +265,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 ", -- 2.13.2