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 5E7316DE2050 for ; Fri, 14 Jul 2017 13:14:30 -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 cr8eF09tDVZ4 for ; Fri, 14 Jul 2017 13:14:29 -0700 (PDT) Received: from che.mayfirst.org (che.mayfirst.org [162.247.75.118]) by arlo.cworth.org (Postfix) with ESMTP id AD9776DE1FF1 for ; Fri, 14 Jul 2017 13:14:28 -0700 (PDT) Received: from fifthhorseman.net (38.200.broadband6.iol.cz [88.101.200.38]) by che.mayfirst.org (Postfix) with ESMTPSA id 9035CF999 for ; Fri, 14 Jul 2017 16:14:25 -0400 (EDT) Received: by fifthhorseman.net (Postfix, from userid 1000) id 30AD81FDEC; Fri, 14 Jul 2017 22:14:23 +0200 (CEST) From: Daniel Kahn Gillmor To: Notmuch Mail Subject: [PATCH v2 2/2] Add additional munged reply-to tests Date: Fri, 14 Jul 2017 22:14:23 +0200 Message-Id: <20170714201423.19688-2-dkg@fifthhorseman.net> X-Mailer: git-send-email 2.13.2 In-Reply-To: <20170714201423.19688-1-dkg@fifthhorseman.net> References: <87fudyq4i9.fsf@tesseract.cs.unb.ca> <20170714201423.19688-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 20:14:30 -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 | 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 wrote: > Un-munging Reply-To OK" +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} 2>&1 && echo OK) +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 +OK" + +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} 2>&1 && echo OK) +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 +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 ", -- 2.13.2