]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/view: ensure HTML shows QP text
authorEric Wong <e@80x24.org>
Mon, 4 Aug 2014 20:24:14 +0000 (20:24 +0000)
committerEric Wong <e@80x24.org>
Mon, 4 Aug 2014 20:24:14 +0000 (20:24 +0000)
We need to ensure the HTML output is not mangled, either.

t/view.t

index 10a182b355da5786a5995c87c40f7208643404f4..bc6fbed9313da848f475e560625a3cef3f50864b 100644 (file)
--- a/t/view.t
+++ b/t/view.t
@@ -110,4 +110,29 @@ EOF
                "parts split with filename");
 }
 
+# multipart collapsed to single quoted-printable text/plain
+{
+       my $parts = [
+               Email::MIME->create(
+                       attributes => {
+                               content_type => 'text/plain',
+                               encoding => 'quoted-printable',
+                       },
+                       body => 'hi = bye',
+               )
+       ];
+       my $mime = Email::MIME->create(
+               header_str => [
+                       From => 'qp@example.com',
+                       Subject => 'QP',
+                       'Message-ID' => '<qp@example.com>',
+                       ],
+               parts => $parts,
+       );
+
+       my $html = PublicInbox::View->msg_html($mime);
+       like($mime->body_raw, qr/hi =3D bye=/, "our test used QP correctly");
+       like($html, qr/\bhi = bye\b/, "HTML output decoded QP");
+}
+
 done_testing();