[Catalyst-commits] r13936 - in Catalyst-Runtime/5.80/trunk/t:
aggregate lib/TestApp/Controller/Action
abraxxa at dev.catalyst.perl.org
abraxxa at dev.catalyst.perl.org
Fri Jan 28 14:09:29 GMT 2011
Author: abraxxa
Date: 2011-01-28 14:09:29 +0000 (Fri, 28 Jan 2011)
New Revision: 13936
Modified:
Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_chained.t
Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Chained.pm
Log:
added test for chained dispatcher fail on multiple CaptureArgs(0) parts introduced in 5.80030
Modified: Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_chained.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_chained.t 2011-01-27 11:01:41 UTC (rev 13935)
+++ Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_chained.t 2011-01-28 14:09:29 UTC (rev 13936)
@@ -847,6 +847,33 @@
}
#
+ # Complex path with multiple non-capturing pathparts
+ # PathPart('') CaptureArgs(0), PathPart('foo') CaptureArgs(0), PathPart('') Args(0)
+ # should win over PathPart('') CaptureArgs(1), PathPart('') Args(0)
+ #
+ {
+ my @expected = qw[
+ TestApp::Controller::Action::Chained->begin
+ TestApp::Controller::Action::Chained->mult_nopp2_base
+ TestApp::Controller::Action::Chained->mult_nopp2_nocap
+ TestApp::Controller::Action::Chained->mult_nopp2_action
+ TestApp::Controller::Action::Chained->mult_nopp2_action_default
+ TestApp::Controller::Action::Chained->end
+ ];
+
+ my $expected = join( ", ", @expected );
+
+ ok( my $response = request('http://localhost/chained/mult_nopp2/action'),
+ "Complex path with multiple non-capturing pathparts" );
+ TODO: {
+ local $TODO = 'Known bug';
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ is( $response->content, '; ', 'Content OK' );
+ }
+ }
+
+ #
# Higher Args() hiding more specific CaptureArgs chains sections
#
{
Modified: Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Chained.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Chained.pm 2011-01-27 11:01:41 UTC (rev 13935)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Chained.pm 2011-01-28 14:09:29 UTC (rev 13936)
@@ -164,6 +164,14 @@
sub mult_nopp_idall : Chained('mult_nopp_id') PathPart('') Args(0) { }
sub mult_nopp_idnew : Chained('mult_nopp_id') PathPart('new') Args(0) { }
+sub mult_nopp2_base : Chained('/') PathPart('chained/mult_nopp2') CaptureArgs(0) { }
+sub mult_nopp2_nocap : Chained('mult_nopp2_base') PathPart('') CaptureArgs(0) { }
+sub mult_nopp2_action : Chained('mult_nopp2_nocap') PathPart('action') CaptureArgs(0) { }
+sub mult_nopp2_action_default : Chained('mult_nopp2_action') PathPart('') Args(0) { }
+sub mult_nopp2_action_with_arg : Chained('mult_nopp2_action') PathPart('') Args(1) { }
+sub mult_nopp2_load : Chained('mult_nopp2_base') PathPart('') CaptureArgs(1) { }
+sub mult_nopp2_view : Chained('mult_nopp2_load') PathPart('') Args(0) { }
+
#
# Test Choice between branches and early return logic
# Declaration order is important for $children->{$*}, since this is first match best.
More information about the Catalyst-commits
mailing list