unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jameson Graef Rollins <jrollins@finestructure.net>
To: Notmuch Mail <notmuch@notmuchmail.org>
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	[thread overview]
Message-ID: <1344793168-23555-1-git-send-email-jrollins@finestructure.net> (raw)
In-Reply-To: <87r4rf9q8x.fsf@qmul.ac.uk>

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 <<EOF > ${MAIL_DIR}/embedded_message
+From: Carl Worth <cworth@cworth.org>
+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
+
+<p>This is the text/html part of a multipart/alternative.</p>
+
+--==-=-==
+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 <<EOF >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

  parent reply	other threads:[~2012-08-12 17:39 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-15 15:55 [PATCH] emacs: add function to toggle display of all multipart/alternative parts Jani Nikula
2012-06-18 21:26 ` Jameson Graef Rollins
2012-06-19  6:56   ` Mark Walters
2012-08-09 20:52     ` Jameson Graef Rollins
2012-08-10  7:10       ` [PATCH v2] " Mark Walters
2012-08-10 14:53         ` Jani Nikula
2012-08-10 16:18           ` Jameson Graef Rollins
2012-08-10 16:39             ` Jani Nikula
2012-08-10 16:58               ` Mark Walters
2012-08-10 17:49                 ` Jameson Graef Rollins
2012-08-12 17:39         ` Jameson Graef Rollins [this message]
2012-08-12 17:39           ` [PATCH 2/2] test: move all emacs show tests to emacs-show test script Jameson Graef Rollins
2012-08-31 19:44             ` David Bremner
2012-10-20  2:31           ` [PATCH 1/2] test: add emacs show mode test for toggling display of multipart/alternative Ethan Glasser-Camp
2012-10-09 22:21         ` [PATCH v2] emacs: add function to toggle display of all multipart/alternative parts Jeremy Nickurak
2012-10-19 16:36         ` Ethan Glasser-Camp
2012-06-19  6:57   ` [PATCH] " Jani Nikula
2012-06-19 20:14 ` [PATCH v2] " Jani Nikula
2012-06-19 20:25   ` Jani Nikula
2012-06-22 22:34   ` David Bremner
2012-06-24  7:10     ` Jani Nikula
2012-06-24 18:56   ` Mark Walters
2012-10-19 16:14     ` [PATCH] Add NEWS item for multipart/alternative toggle Ethan Glasser-Camp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344793168-23555-1-git-send-email-jrollins@finestructure.net \
    --to=jrollins@finestructure.net \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).