unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] test: Fix HTML rendering test
@ 2012-10-24 20:06 Austin Clements
  2012-10-25  1:59 ` Ethan Glasser-Camp
  0 siblings, 1 reply; 5+ messages in thread
From: Austin Clements @ 2012-10-24 20:06 UTC (permalink / raw)
  To: notmuch

The test designed to exercise Emacs' rendering of HTML emails
containing images inadvertently assumed w3m was available under Emacs
23.  The real point of this test was to exercise Emacs 24's shr
renderer, so if shr isn't available, we now fall back to html2text,
which comes with Emacs.
---
 test/emacs |   11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/test/emacs b/test/emacs
index 1f84b91..2ef78bf 100755
--- a/test/emacs
+++ b/test/emacs
@@ -756,7 +756,7 @@ add_message '[subject]="HTML mail with images"' \
     '[body]="--abcd
 Content-Type: text/html
 
-<img src="cid:330@goomoji.gmail">
+<img src="cid:330@goomoji.gmail"> smiley
 
 --abcd
 Content-Type: image/gif
@@ -766,10 +766,13 @@ Content-ID: <330@goomoji.gmail>
 R0lGODlhDAAMAKIFAF5LAP/zxAAAANyuAP/gaP///wAAAAAAACH5BAEAAAUALAAAAAAMAAwAAAMl
 WLPcGjDKFYi9lxKBOaGcF35DhWHamZUW0K4mAbiwWtuf0uxFAgA7
 --abcd--"'
-test_emacs "(notmuch-show \"id:${gen_msg_id}\")
+test_emacs "(let ((mm-text-html-renderer
+		   (if (assq 'shr mm-text-html-renderer-alist)
+		       'shr 'html2text)))
+	      (notmuch-show \"id:${gen_msg_id}\"))
 	    (test-output)"
 # Normalize output for Emacs 23 and Emacs 24
-sed -i 's/\[cid\]/*/' OUTPUT
+sed -i 's/^ smiley/* smiley/' OUTPUT
 cat <<EOF >EXPECTED
 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (inbox)
 Subject: HTML mail with images
@@ -778,7 +781,7 @@ Date: Fri, 05 Jan 2001 15:43:57 +0000
 
 [ multipart/related ]
 [ text/html ]
-*
+* smiley
 EOF
 test_expect_equal_file OUTPUT EXPECTED
 
-- 
1.7.10

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-10-25 13:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-24 20:06 [PATCH] test: Fix HTML rendering test Austin Clements
2012-10-25  1:59 ` Ethan Glasser-Camp
2012-10-25  2:11   ` Austin Clements
2012-10-25  8:06     ` Tomi Ollila
2012-10-25 13:28     ` Ethan Glasser-Camp

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).