X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Flib%2FTestAppEncoding%2FController%2FRoot.pm;h=72296ad3a1c407d2ee57a1a2414e4ac2de4b0319;hp=391a2cdc30783f8621ea26e5e474266ae9306e45;hb=88e5a8b0c4d28e46b8ba6b6b9567063e57af9063;hpb=b42b9094c7f1a5cf0cb7750255ea6b0a1de45ddf diff --git a/t/lib/TestAppEncoding/Controller/Root.pm b/t/lib/TestAppEncoding/Controller/Root.pm index 391a2cd..72296ad 100644 --- a/t/lib/TestAppEncoding/Controller/Root.pm +++ b/t/lib/TestAppEncoding/Controller/Root.pm @@ -8,7 +8,12 @@ __PACKAGE__->config->{namespace} = ''; sub binary : Local { my ($self, $c) = @_; - $c->res->body(do { open(my $fh, '<', $c->path_to('..', '..', 'catalyst_130pix.gif')) or die $!; binmode($fh); local $/ = undef; <$fh>; }); + $c->res->content_type('image/gif'); + $c->res->body(do { + open(my $fh, '<', $c->path_to('..', '..', 'catalyst_130pix.gif')) or die $!; + binmode($fh); + local $/ = undef; <$fh>; + }); } sub binary_utf8 : Local { @@ -20,6 +25,19 @@ sub binary_utf8 : Local { $c->res->body($str); } +# called by t/aggregate/catalyst_test_utf8.t +sub utf8_non_ascii_content : Local { + use utf8; + my ($self, $c) = @_; + + my $str = 'ʇsʎlɐʇɐɔ'; # 'catalyst' flipped at http://www.revfad.com/flip.html + ok utf8::is_utf8($str), '$str is in UTF8 internally'; + + $c->res->content_type('text/plain'); + $c->res->body($str); +} + + sub end : Private { my ($self,$c) = @_; }