[PATCH 1/2] test: add emacs show mode test for toggling display of multipart/alternative
authorJameson Graef Rollins <jrollins@finestructure.net>
Sun, 12 Aug 2012 17:39:27 +0000 (10:39 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:03 +0000 (09:49 -0800)
96/047d5d8633032c5863c6df345d17cee9492826 [new file with mode: 0644]

diff --git a/96/047d5d8633032c5863c6df345d17cee9492826 b/96/047d5d8633032c5863c6df345d17cee9492826
new file mode 100644 (file)
index 0000000..84378bf
--- /dev/null
@@ -0,0 +1,121 @@
+Return-Path: <jrollins@finestructure.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 90487431FB6\r
+       for <notmuch@notmuchmail.org>; Sun, 12 Aug 2012 10:39:35 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id IugtF-uCWNxh for <notmuch@notmuchmail.org>;\r
+       Sun, 12 Aug 2012 10:39:34 -0700 (PDT)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+       [131.215.239.19])\r
+       by olra.theworths.org (Postfix) with ESMTP id C701F431FAE\r
+       for <notmuch@notmuchmail.org>; Sun, 12 Aug 2012 10:39:34 -0700 (PDT)\r
+Received: from fire-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+       by fire-doxen-postvirus (Postfix) with ESMTP id 7042A2E50DDB\r
+       for <notmuch@notmuchmail.org>; Sun, 12 Aug 2012 10:39:32 -0700 (PDT)\r
+X-Spam-Scanned: at Caltech-IMSS on fire-doxen by amavisd-new\r
+Received: from finestructure.net (unknown [76.89.192.57])\r
+       (Authenticated sender: jrollins)\r
+       by fire-doxen-submit (Postfix) with ESMTP id 2FD5B2E50DA6\r
+       for <notmuch@notmuchmail.org>; Sun, 12 Aug 2012 10:39:30 -0700 (PDT)\r
+Received: by finestructure.net (Postfix, from userid 1000)\r
+       id C7C672E7; Sun, 12 Aug 2012 10:39:28 -0700 (PDT)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH 1/2] test: add emacs show mode test for toggling display of\r
+       multipart/alternative\r
+Date: Sun, 12 Aug 2012 10:39:27 -0700\r
+Message-Id: <1344793168-23555-1-git-send-email-jrollins@finestructure.net>\r
+X-Mailer: git-send-email 1.7.10.4\r
+In-Reply-To: <87r4rf9q8x.fsf@qmul.ac.uk>\r
+References: <87r4rf9q8x.fsf@qmul.ac.uk>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 12 Aug 2012 17:39:35 -0000\r
+\r
+Fairly simple test that looks at a diff of test-emacs output from each\r
+case.\r
+---\r
+As I mentioned, I really like this toggle view solution, so here's a\r
+test for it.\r
+\r
+ test/emacs-show |   47 +++++++++++++++++++++++++++++++++++++++++++++++\r
+ 1 file changed, 47 insertions(+)\r
+\r
+diff --git a/test/emacs-show b/test/emacs-show\r
+index e9a714f..695f929 100755\r
+--- a/test/emacs-show\r
++++ b/test/emacs-show\r
+@@ -36,4 +36,51 @@ test_begin_subtest "Bare subject #3"\r
+ output=$(test_emacs '(notmuch-show-strip-re "the cure: fix the regexp")')\r
+ test_expect_equal "$output" '"the cure: fix the regexp"'\r
\r
++test_begin_subtest "Toggle display multipart/alternative"\r
++cat <<EOF > ${MAIL_DIR}/embedded_message\r
++From: Carl Worth <cworth@cworth.org>\r
++To: cworth@cworth.org\r
++Subject: html message\r
++Date: Fri, 05 Jan 2001 15:42:57 +0000\r
++User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu)\r
++Message-ID: <87liy5ap01.fsf@yoom.home.cworth.org>\r
++MIME-Version: 1.0\r
++Content-Type: multipart/alternative; boundary="==-=-=="\r
++\r
++--==-=-==\r
++Content-Type: text/html\r
++\r
++<p>This is the text/html part of a multipart/alternative.</p>\r
++\r
++--==-=-==\r
++Content-Type: text/plain\r
++\r
++This is the text/plain part of a multipart/alternative.\r
++\r
++--==-=-==--\r
++EOF\r
++notmuch new > /dev/null\r
++test_emacs "(let ((notmuch-show-all-multipart/alternative-parts nil))\r
++              (notmuch-show \"id:87liy5ap01.fsf@yoom.home.cworth.org\")\r
++            (test-output))"\r
++mv OUTPUT{,.text}\r
++test_emacs "(let ((notmuch-show-all-multipart/alternative-parts nil))\r
++              (notmuch-show \"id:87liy5ap01.fsf@yoom.home.cworth.org\")\r
++              (notmuch-show-cycle-message-multipart)\r
++            (test-output))"\r
++mv OUTPUT{,.html}\r
++diff OUTPUT.{text,html} >OUTPUT.diff\r
++cat <<EOF >EXPECTED.diff\r
++7,9c7,10\r
++< [ text/html (not shown) ]\r
++< [ text/plain ]\r
++< This is the text/plain part of a multipart/alternative.\r
++---\r
++> [ text/html ]\r
++> This is the text/html part of a multipart/alternative.\r
++> \r
++> [ text/plain (not shown) ]\r
++EOF\r
++test_expect_equal_file {OUTPUT,EXPECTED}.diff\r
++\r
+ test_done\r
+-- \r
+1.7.10.4\r
+\r