X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FTestApp%2FController%2FAction%2FRegexp.pm;h=4b59d58641f5b21ad3b814291fdb95215a35e28b;hb=a8f4e833e16a5d2f034afbaf3a94ecdb475ec9cb;hp=5413b6c3a768bfaeba86cbba11dacea7e803c693;hpb=dd4e6fd2152eea9f5b0c1f559575ced7684ef257;p=catagits%2FCatalyst-Runtime.git diff --git a/t/lib/TestApp/Controller/Action/Regexp.pm b/t/lib/TestApp/Controller/Action/Regexp.pm index 5413b6c..4b59d58 100644 --- a/t/lib/TestApp/Controller/Action/Regexp.pm +++ b/t/lib/TestApp/Controller/Action/Regexp.pm @@ -3,14 +3,28 @@ package TestApp::Controller::Action::Regexp; use strict; use base 'TestApp::Controller::Action'; -sub one : Action Regexp('^action/regexp/(\w+)/(\d+)$') { +sub one : Action Regex('^action/regexp/(\w+)/(\d+)$') { my ( $self, $c ) = @_; $c->forward('TestApp::View::Dump::Request'); } -sub two : Action Regex('^action/regexp/(\d+)/(\w+)$') { +sub two : Action LocalRegexp('^(\d+)/(\w+)$') { my ( $self, $c ) = @_; $c->forward('TestApp::View::Dump::Request'); } +sub three : Action LocalRegex('^(mandatory)(/optional)?$'){ + my ( $self, $c ) = @_; + $c->forward('TestApp::View::Dump::Request'); +} + +sub four : Action Regex('^action/regexp/redirect/(\w+)/universe/(\d+)/everything$') { + my ( $self, $c ) = @_; + $c->res->redirect( + $c->uri_for($c->action, $c->req->captures, + @{$c->req->arguments}, $c->req->params + ) + ); +} + 1;