diff options
author | Eric Wong <e@80x24.org> | 2015-08-17 02:41:18 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2015-08-17 03:14:21 +0000 |
commit | 53d0c896f8804d9c5c7a7b18b927e9a425b88a3a (patch) | |
tree | 8f318f82d4f3a0c70ebfdbd5551f4bd176db36fe /t/view.t | |
parent | 52aff6ba71ad0c13c28d2ffaea43c157546a1daf (diff) | |
download | public-inbox-53d0c896f8804d9c5c7a7b18b927e9a425b88a3a.tar.gz |
We can rely on reference counting to lower memory usage for big messages.
Diffstat (limited to 't/view.t')
-rw-r--r-- | t/view.t | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -39,9 +39,9 @@ EOF Subject => 'this is a subject', ], body => $body, - ); - $s = Email::MIME->new($s->as_string); - my $html = PublicInbox::View->msg_html($s); + )->as_string; + my $mime = Email::MIME->new($s); + my $html = PublicInbox::View->msg_html($mime); # ghetto tests like($html, qr!<a\nhref="\.\./m/hello%40!s, "MID link present"); @@ -52,7 +52,8 @@ EOF # short page my $pfx = "http://example.com/test/f"; - my $short = PublicInbox::View->msg_html($s, $pfx); + $mime = Email::MIME->new($s); + my $short = PublicInbox::View->msg_html($mime, $pfx); like($short, qr!<a\nhref="hello%40!s, "MID link present"); like($short, qr/\n> keep this inline/, "short quoted text is inline"); @@ -137,8 +138,9 @@ EOF parts => $parts, ); + my $orig = $mime->body_raw; my $html = PublicInbox::View->msg_html($mime); - like($mime->body_raw, qr/hi =3D bye=/, "our test used QP correctly"); + like($orig, qr/hi =3D bye=/, "our test used QP correctly"); like($html, qr/\bhi = bye\b/, "HTML output decoded QP"); } |