Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id D52D8421183 for ; Sun, 1 Apr 2012 08:24:30 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 9yI1jwiN+LnH for ; Sun, 1 Apr 2012 08:24:29 -0700 (PDT) Received: from idcmail-mo1so.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by olra.theworths.org (Postfix) with ESMTP id 09160431E82 for ; Sun, 1 Apr 2012 08:24:28 -0700 (PDT) Received: from pd4ml3so-ssvc.prod.shaw.ca ([10.0.141.150]) by pd4mo1so-svcs.prod.shaw.ca with ESMTP; 01 Apr 2012 09:24:28 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.1 cv=b/gStvK98Bs6YfhBwCpxRApoLO2qoBYaarCtclPE+68= c=1 sm=1 a=hmG0ygz5IAsA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17 a=7343-z1_AAAA:8 a=A1X0JdhQAAAA:8 a=V2sgnzSHAAAA:8 a=pGLkceISAAAA:8 a=_LmHKsysBck4L4_JhPEA:9 a=vH5s_6-iUSyMLwNrW-IA:7 a=0BPXsuqt4rsA:10 a=0c-eHkXYtrgA:10 a=Y6qChIQXU1wA:10 a=Gb7Eya4fYr0A:10 a=MSl-tDqOz04A:10 a=5WXwG0oxU3rw_xjX:21 a=L0hUfwXD39SVSbtn:21 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56]) by pd4ml3so-dmz.prod.shaw.ca with ESMTP; 01 Apr 2012 09:24:28 -0600 Received: by lagos.xvx.ca (Postfix, from userid 1000) id E4C0F800482D; Sun, 1 Apr 2012 09:24:26 -0600 (MDT) From: Adam Wolfe Gordon To: notmuch@notmuchmail.org Subject: [BUG/PATCH v4 3/4] test: Show all headers in emacs reply tests Date: Sun, 1 Apr 2012 09:24:22 -0600 Message-Id: <1333293863-14361-4-git-send-email-awg+notmuch@xvx.ca> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: <1333293863-14361-1-git-send-email-awg+notmuch@xvx.ca> References: <1333240404-13076-1-git-send-email-awg+notmuch@xvx.ca> <1333293863-14361-1-git-send-email-awg+notmuch@xvx.ca> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Sun, 01 Apr 2012 15:24:31 -0000 By default, emacs hides the User-Agent and References headers when composing mail. This is a good thing for users, but a bad thing for testing, since we can create ugly or invalid headers and not have it show up in the tests. By setting message-hidden-headers to an empty list, we force emacs to show all the headers, so we can check that they're correct. Users won't see this, but it will let us catch future bugs. As a side-effect, this breaks all the reply tests, since there is a bug with the References and User-Agent headers, fixed in the next commit. --- test/emacs | 55 +++++++++++++++++++++++++++++++++++++++++++------------ 1 files changed, 43 insertions(+), 12 deletions(-) diff --git a/test/emacs b/test/emacs index 30654bb..15cc778 100755 --- a/test/emacs +++ b/test/emacs @@ -267,17 +267,23 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "Reply within emacs" -test_emacs '(notmuch-search "subject:\"testing message sent via SMTP\"") +test_subtest_known_broken +test_emacs '(let ((message-hidden-headers ''())) + (notmuch-search "subject:\"testing message sent via SMTP\"") (notmuch-test-wait) (notmuch-search-reply-to-thread) - (test-output)' + (test-output))' sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: /' OUTPUT +sed -i -e 's/^References: <.*>$/References: /' OUTPUT +sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT cat <EXPECTED From: Notmuch Test Suite To: user@example.com Subject: Re: Testing message sent via SMTP In-Reply-To: Fcc: ${MAIL_DIR}/sent +References: +User-Agent: Notmuch/XXX Emacs/XXX --text follows this line-- Notmuch Test Suite writes: @@ -286,19 +292,24 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "Reply from alternate address within emacs" +test_subtest_known_broken add_message '[from]="Sender "' \ [to]=test_suite_other@notmuchmail.org -test_emacs "(notmuch-search \"id:\\\"${gen_msg_id}\\\"\") +test_emacs "(let ((message-hidden-headers '())) + (notmuch-search \"id:\\\"${gen_msg_id}\\\"\") (notmuch-test-wait) (notmuch-search-reply-to-thread) - (test-output)" + (test-output))" +sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT cat <EXPECTED From: Notmuch Test Suite To: Sender Subject: Re: ${test_subtest_name} In-Reply-To: <${gen_msg_id}> Fcc: ${MAIL_DIR}/sent +References: <${gen_msg_id}> +User-Agent: Notmuch/XXX Emacs/XXX --text follows this line-- Sender writes: @@ -307,20 +318,25 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "Reply from address in named group list within emacs" +test_subtest_known_broken add_message '[from]="Sender "' \ '[to]=group:test_suite@notmuchmail.org,someone@example.com\;' \ [cc]=test_suite_other@notmuchmail.org -test_emacs "(notmuch-search \"id:\\\"${gen_msg_id}\\\"\") +test_emacs "(let ((message-hidden-headers '())) + (notmuch-search \"id:\\\"${gen_msg_id}\\\"\") (notmuch-test-wait) (notmuch-search-reply-to-thread) - (test-output)" + (test-output))" +sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT cat <EXPECTED From: Notmuch Test Suite To: Sender , someone@example.com Subject: Re: ${test_subtest_name} In-Reply-To: <${gen_msg_id}> Fcc: ${MAIL_DIR}/sent +References: <${gen_msg_id}> +User-Agent: Notmuch/XXX Emacs/XXX --text follows this line-- Sender writes: @@ -329,15 +345,20 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "Reply within emacs to a multipart/mixed message" -test_emacs '(notmuch-show "id:20091118002059.067214ed@hikari") +test_subtest_known_broken +test_emacs '(let ((message-hidden-headers ''())) + (notmuch-show "id:20091118002059.067214ed@hikari") (notmuch-show-reply) - (test-output)' + (test-output))' +sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT cat <EXPECTED From: Notmuch Test Suite To: Adrian Perez de Castro , notmuch@notmuchmail.org Subject: Re: [notmuch] Introducing myself In-Reply-To: <20091118002059.067214ed@hikari> Fcc: ${MAIL_DIR}/sent +References: <20091118002059.067214ed@hikari> +User-Agent: Notmuch/XXX Emacs/XXX --text follows this line-- Adrian Perez de Castro writes: @@ -388,15 +409,20 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "Reply within emacs to a multipart/alternative message" -test_emacs '(notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") +test_subtest_known_broken +test_emacs '(let ((message-hidden-headers ''())) + (notmuch-show "id:cf0c4d610911171136h1713aa59w9cf9aa31f052ad0a@mail.gmail.com") (notmuch-show-reply) - (test-output)' + (test-output))' +sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT cat <EXPECTED From: Notmuch Test Suite To: Alex Botero-Lowry , notmuch@notmuchmail.org Subject: Re: [notmuch] preliminary FreeBSD support In-Reply-To: Fcc: ${MAIL_DIR}/sent +References: +User-Agent: Notmuch/XXX Emacs/XXX --text follows this line-- Alex Botero-Lowry writes: @@ -424,19 +450,24 @@ EOF test_expect_equal_file OUTPUT EXPECTED test_begin_subtest "Quote MML tags in reply" +test_subtest_known_broken message_id='test-emacs-mml-quoting@message.id' add_message [id]="$message_id" \ "[subject]='$test_subtest_name'" \ '[body]="<#part disposition=inline>"' -test_emacs "(notmuch-show \"id:$message_id\") +test_emacs "(let ((message-hidden-headers '())) + (notmuch-show \"id:$message_id\") (notmuch-show-reply) - (test-output)" + (test-output))" +sed -i -e 's,^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' OUTPUT cat <EXPECTED From: Notmuch Test Suite To: Subject: Re: Quote MML tags in reply In-Reply-To: Fcc: ${MAIL_DIR}/sent +References: +User-Agent: Notmuch/XXX Emacs/XXX --text follows this line-- Notmuch Test Suite writes: -- 1.7.5.4