- unescape captures to match args
- fix for relative Chained under namespace '' (root)
- fix for hashrefs in action attributes from config
+ - fix for Chained to require correct number of CaptureArgs
5.7001 2006-07-19 23:46:54
- fix for component loading
my @try_actions = @{$children->{$try_part}};
TRY_ACTION: foreach my $action (@try_actions) {
if (my $capture_attr = $action->attributes->{CaptureArgs}) {
+
+ # Short-circuit if not enough remaining parts
+ next TRY_ACTION unless @parts >= $capture_attr->[0];
+
my @captures;
my @parts = @parts; # localise
sub empty_chain_e : Chained('empty_chain_d') PathPart('') CaptureArgs(0) { }
sub empty_chain_f : Chained('empty_chain_e') PathPart('') Args(1) { }
+sub mult_nopp_base : Chained('/') PathPart('chained/mult_nopp') CaptureArgs(0) { }
+sub mult_nopp_all : Chained('mult_nopp_base') PathPart('') Args(0) { }
+sub mult_nopp_new : Chained('mult_nopp_base') PathPart('new') Args(0) { }
+sub mult_nopp_id : Chained('mult_nopp_base') PathPart('') CaptureArgs(1) { }
+sub mult_nopp_idall : Chained('mult_nopp_id') PathPart('') Args(0) { }
+sub mult_nopp_idnew : Chained('mult_nopp_id') PathPart('new') Args(0) { }
+
sub end :Private {
my ($self, $c) = @_;
return if $c->stash->{no_end};
BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
-use Test::More tests => 103*$iters;
+use Test::More tests => 106*$iters;
use Catalyst::Test 'TestApp';
if ( $ENV{CAT_BENCHMARK} ) {
}
else { pass( "Error on absolute path part arguments already tested" ) }
}
+
+ #
+ # Complex path with multiple empty pathparts
+ #
+ {
+ my @expected = qw[
+ TestApp::Controller::Action::Chained->begin
+ TestApp::Controller::Action::Chained->mult_nopp_base
+ TestApp::Controller::Action::Chained->mult_nopp_all
+ TestApp::Controller::Action::Chained->end
+ ];
+
+ my $expected = join( ", ", @expected );
+
+ ok( my $response = request('http://localhost/chained/mult_nopp'),
+ "Complex path with multiple empty pathparts" );
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ is( $response->content, '; ', 'Content OK' );
+ }
+
}