From: Jameson Graef Rollins Date: Sun, 12 Aug 2012 17:39:27 +0000 (+1700) Subject: [PATCH 1/2] test: add emacs show mode test for toggling display of multipart/alternative X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=3a5c45aef49bbc9d6e86ff9145d3f2d4b90d22f5;p=notmuch-archives.git [PATCH 1/2] test: add emacs show mode test for toggling display of multipart/alternative --- diff --git a/96/047d5d8633032c5863c6df345d17cee9492826 b/96/047d5d8633032c5863c6df345d17cee9492826 new file mode 100644 index 000000000..84378bf54 --- /dev/null +++ b/96/047d5d8633032c5863c6df345d17cee9492826 @@ -0,0 +1,121 @@ +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 90487431FB6 + for ; Sun, 12 Aug 2012 10:39:35 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.3 +X-Spam-Level: +X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_MED=-2.3] 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 IugtF-uCWNxh for ; + Sun, 12 Aug 2012 10:39:34 -0700 (PDT) +Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu + [131.215.239.19]) + by olra.theworths.org (Postfix) with ESMTP id C701F431FAE + for ; Sun, 12 Aug 2012 10:39:34 -0700 (PDT) +Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1]) + by fire-doxen-postvirus (Postfix) with ESMTP id 7042A2E50DDB + for ; Sun, 12 Aug 2012 10:39:32 -0700 (PDT) +X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new +Received: from finestructure.net (unknown [76.89.192.57]) + (Authenticated sender: jrollins) + by fire-doxen-submit (Postfix) with ESMTP id 2FD5B2E50DA6 + for ; Sun, 12 Aug 2012 10:39:30 -0700 (PDT) +Received: by finestructure.net (Postfix, from userid 1000) + id C7C672E7; Sun, 12 Aug 2012 10:39:28 -0700 (PDT) +From: Jameson Graef Rollins +To: Notmuch Mail +Subject: [PATCH 1/2] test: add emacs show mode test for toggling display of + multipart/alternative +Date: Sun, 12 Aug 2012 10:39:27 -0700 +Message-Id: <1344793168-23555-1-git-send-email-jrollins@finestructure.net> +X-Mailer: git-send-email 1.7.10.4 +In-Reply-To: <87r4rf9q8x.fsf@qmul.ac.uk> +References: <87r4rf9q8x.fsf@qmul.ac.uk> +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, 12 Aug 2012 17:39:35 -0000 + +Fairly simple test that looks at a diff of test-emacs output from each +case. +--- +As I mentioned, I really like this toggle view solution, so here's a +test for it. + + test/emacs-show | 47 +++++++++++++++++++++++++++++++++++++++++++++++ + 1 file changed, 47 insertions(+) + +diff --git a/test/emacs-show b/test/emacs-show +index e9a714f..695f929 100755 +--- a/test/emacs-show ++++ b/test/emacs-show +@@ -36,4 +36,51 @@ test_begin_subtest "Bare subject #3" + output=$(test_emacs '(notmuch-show-strip-re "the cure: fix the regexp")') + test_expect_equal "$output" '"the cure: fix the regexp"' + ++test_begin_subtest "Toggle display multipart/alternative" ++cat < ${MAIL_DIR}/embedded_message ++From: Carl Worth ++To: cworth@cworth.org ++Subject: html message ++Date: Fri, 05 Jan 2001 15:42:57 +0000 ++User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu) ++Message-ID: <87liy5ap01.fsf@yoom.home.cworth.org> ++MIME-Version: 1.0 ++Content-Type: multipart/alternative; boundary="==-=-==" ++ ++--==-=-== ++Content-Type: text/html ++ ++

This is the text/html part of a multipart/alternative.

++ ++--==-=-== ++Content-Type: text/plain ++ ++This is the text/plain part of a multipart/alternative. ++ ++--==-=-==-- ++EOF ++notmuch new > /dev/null ++test_emacs "(let ((notmuch-show-all-multipart/alternative-parts nil)) ++ (notmuch-show \"id:87liy5ap01.fsf@yoom.home.cworth.org\") ++ (test-output))" ++mv OUTPUT{,.text} ++test_emacs "(let ((notmuch-show-all-multipart/alternative-parts nil)) ++ (notmuch-show \"id:87liy5ap01.fsf@yoom.home.cworth.org\") ++ (notmuch-show-cycle-message-multipart) ++ (test-output))" ++mv OUTPUT{,.html} ++diff OUTPUT.{text,html} >OUTPUT.diff ++cat <EXPECTED.diff ++7,9c7,10 ++< [ text/html (not shown) ] ++< [ text/plain ] ++< This is the text/plain part of a multipart/alternative. ++--- ++> [ text/html ] ++> This is the text/html part of a multipart/alternative. ++> ++> [ text/plain (not shown) ] ++EOF ++test_expect_equal_file {OUTPUT,EXPECTED}.diff ++ + test_done +-- +1.7.10.4 +