X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestApp%2FController%2FRoot.pm;h=ce3ee757de9a07f79b8a3ebcc83021356204f89d;hb=ffb438031c2764e94ffe9e9af68a1b172eac4740;hp=18c6db802fe7bae9a59b93132bce6f3ddf66efd2;hpb=f23f16344c6e965eb8b0f31032711b2c205f1751;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestApp/Controller/Root.pm b/t/lib/TestApp/Controller/Root.pm index 18c6db8..ce3ee75 100644 --- a/t/lib/TestApp/Controller/Root.pm +++ b/t/lib/TestApp/Controller/Root.pm @@ -14,6 +14,16 @@ sub zero : Path('0') { $c->forward('TestApp::View::Dump::Request'); } +sub zerobody : Local { + my ($self, $c) = @_; + $c->res->body('0'); +} + +sub emptybody : Local { + my ($self, $c) = @_; + $c->res->body(''); +} + sub localregex : LocalRegex('^localregex$') { my ( $self, $c ) = @_; $c->res->header( 'X-Test-Class' => ref($self) ); @@ -65,6 +75,13 @@ EndOfBody $c->response->body($body); } +sub body_semipredicate : Local { + my ($self, $c) = @_; + $c->res->body; # Old code tests length($c->res->body), which causes the value to be built (undef), which causes the predicate + $c->res->status( $c->res->has_body ? 500 : 200 ); # to return the wrong thing, resulting in a 500. + $c->res->body('Body'); +} + sub end : Private { my ($self,$c) = @_; }