diff options
author | Eric Wong <e@80x24.org> | 2019-12-18 03:36:43 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-12-19 03:59:17 +0000 |
commit | 684d26cecc0891261783be179909b0e434692b25 (patch) | |
tree | a1d78c9f23792d0272ee542c06cd347b848cffc6 /t/view.t | |
parent | 55b11c59936125aab26694e17631828c7ea9954e (diff) | |
download | public-inbox-684d26cecc0891261783be179909b0e434692b25.tar.gz |
These usages of file-local global variables make the *.t files incompatible with run_script(). Instead, use anonymous subs, "our", or pass the parameter as appropriate.
Diffstat (limited to 't/view.t')
-rw-r--r-- | t/view.t | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -24,8 +24,8 @@ my $ctx = { }; $ctx->{-inbox}->{-primary_address} = 'test@example.com'; -sub msg_html ($) { - my ($mime) = @_; +sub msg_html ($$) { + my ($ctx, $mime) = @_; my $s = ''; my $r = PublicInbox::View::msg_html($ctx, $mime); @@ -72,7 +72,7 @@ EOF body => $body, )->as_string; my $mime = Email::MIME->new($s); - my $html = msg_html($mime); + my $html = msg_html($ctx, $mime); # ghetto tests like($html, qr!<a\nhref="raw"!s, "raw link present"); @@ -102,7 +102,7 @@ EOF parts => $parts, ); - my $html = msg_html($mime); + my $html = msg_html($ctx, $mime); like($html, qr/hi\n.*-- Attachment #2.*\nbye\n/s, "multipart split"); } @@ -131,7 +131,7 @@ EOF parts => $parts, ); - my $html = msg_html($mime); + my $html = msg_html($ctx, $mime); like($html, qr!.*Attachment #2: foo&(?:amp|#38);\.patch --!, "parts split with filename"); } @@ -157,7 +157,7 @@ EOF ); my $orig = $mime->body_raw; - my $html = msg_html($mime); + my $html = msg_html($ctx, $mime); like($orig, qr/hi =3D bye=/, "our test used QP correctly"); like($html, qr/\bhi = bye\b/, "HTML output decoded QP"); } |