5.7014 ---
- Fix regression for relative uri_for arguments after a forward()
introduced in 5.7013 (Peter Karman)
+ - Fix regression for "sub foo : Path {}" in the root controller which
+ was introduced when attempting to allow "0" as a Path.
5.7013 2008-05-16 18:20:00
- Provide backwards compatability methods in Catalyst::Stats
sub match {
my ( $self, $c, $path ) = @_;
- $path = '/' if !defined $path;
+ $path = '/' if !defined $path || !length $path;
foreach my $action ( @{ $self->{paths}->{$path} || [] } ) {
next unless $action->match($c);
--- /dev/null
+#!perl
+
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+our $iters;
+
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
+
+use Test::More tests => 2*$iters;
+use Catalyst::Test 'TestAppPathBug';
+
+if ( $ENV{CAT_BENCHMARK} ) {
+ require Benchmark;
+ Benchmark::timethis( $iters, \&run_tests );
+}
+else {
+ for ( 1 .. $iters ) {
+ run_tests();
+ }
+}
+
+sub run_tests {
+ SKIP:
+ {
+ if ( $ENV{CATALYST_SERVER} ) {
+ skip 'Using remote server', 2;
+ }
+
+ {
+ my $expected = 'This is the foo method.';
+ ok( my $response = request('http://localhost/'), 'response ok' );
+ is( $response->content, $expected, 'Content OK' );
+ }
+ }
+}
--- /dev/null
+use strict;
+use warnings;
+
+package TestAppPathBug;
+
+use Catalyst;
+
+our $VERSION = '0.01';
+
+__PACKAGE__->config( name => 'TestAppPathBug', root => '/some/dir' );
+
+__PACKAGE__->setup;
+
+sub foo : Path {
+ my ( $self, $c ) = @_;
+ $c->res->body( 'This is the foo method.' );
+}
+
+1;