From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.0 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 89DBD1FB58; Tue, 5 Aug 2014 00:45:13 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Cc: Eric Wong Subject: [PATCH 2/2] t/view: ensure HTML shows QP text Date: Tue, 5 Aug 2014 00:45:06 +0000 Message-Id: <1407199506-15596-2-git-send-email-e@80x24.org> X-Mailer: git-send-email 2.0.1.427.gc47372d In-Reply-To: <1407199506-15596-1-git-send-email-e@80x24.org> References: <1407199506-15596-1-git-send-email-e@80x24.org> List-Id: We need to ensure the HTML output is not mangled, either. --- t/view.t | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/t/view.t b/t/view.t index 10a182b..bc6fbed 100644 --- 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' => '', + ], + 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(); -- 2.0.1.427.gc47372d