Cosmetic: wrapped long code line
[catagits/Catalyst-Runtime.git] / t / lib / TestAppEncoding / Controller / Root.pm
1 package TestAppEncoding::Controller::Root;
2 use strict;
3 use warnings;
4 use base 'Catalyst::Controller';
5 use Test::More;
6
7 __PACKAGE__->config->{namespace} = '';
8
9 sub binary : Local {
10     my ($self, $c) = @_;
11     $c->res->body(do { 
12         open(my $fh, '<', $c->path_to('..', '..', 'catalyst_130pix.gif')) or die $!; 
13         binmode($fh); 
14         local $/ = undef; <$fh>;
15     });
16 }
17
18 sub binary_utf8 : Local {
19     my ($self, $c) = @_;
20     $c->forward('binary');
21     my $str = $c->res->body;
22     utf8::upgrade($str);
23     ok utf8::is_utf8($str), 'Body is variable width encoded string';
24     $c->res->body($str);
25 }
26
27 sub end : Private {
28     my ($self,$c) = @_;
29 }
30
31 1;