[Catalyst-commits] r13435 - in Catalyst-Plugin-Params-Nested/trunk:
. lib/Catalyst/Plugin/Params/Nested t
t0m at dev.catalyst.perl.org
t0m at dev.catalyst.perl.org
Wed Jul 28 21:29:47 GMT 2010
Author: t0m
Date: 2010-07-28 22:29:47 +0100 (Wed, 28 Jul 2010)
New Revision: 13435
Modified:
Catalyst-Plugin-Params-Nested/trunk/Changes
Catalyst-Plugin-Params-Nested/trunk/lib/Catalyst/Plugin/Params/Nested/Expander.pm
Catalyst-Plugin-Params-Nested/trunk/t/basic.t
Log:
Apply patch from RT#59604
Modified: Catalyst-Plugin-Params-Nested/trunk/Changes
===================================================================
--- Catalyst-Plugin-Params-Nested/trunk/Changes 2010-07-28 16:07:55 UTC (rev 13434)
+++ Catalyst-Plugin-Params-Nested/trunk/Changes 2010-07-28 21:29:47 UTC (rev 13435)
@@ -1,3 +1,4 @@
+ - Fixed RT:59604 `param[]` causing copy to `param` (ECARROLL)
- 0.03 2010-04-14 22:45:00
- Update to change NEXT to MRO::Compat
- Change Module::Build to Module::Install
Modified: Catalyst-Plugin-Params-Nested/trunk/lib/Catalyst/Plugin/Params/Nested/Expander.pm
===================================================================
--- Catalyst-Plugin-Params-Nested/trunk/lib/Catalyst/Plugin/Params/Nested/Expander.pm 2010-07-28 16:07:55 UTC (rev 13434)
+++ Catalyst-Plugin-Params-Nested/trunk/lib/Catalyst/Plugin/Params/Nested/Expander.pm 2010-07-28 21:29:47 UTC (rev 13435)
@@ -1,5 +1,3 @@
-#!/usr/bin/perl
-
package Catalyst::Plugin::Params::Nested::Expander;
use base qw/CGI::Expand/;
@@ -9,9 +7,9 @@
sub split_name {
my ( $class, $name ) = @_;
- if ( $name =~ /^ \w+ \[/x ) {
+ if ( $name =~ /^ .*? \[ \S+ \]/x ) {
return grep { defined } ( $name =~ /
- ^ (\w+) # root param
+ ^ (\w+) # root param
| \[ (\w+) \] # nested
/gx );
} else {
Modified: Catalyst-Plugin-Params-Nested/trunk/t/basic.t
===================================================================
--- Catalyst-Plugin-Params-Nested/trunk/t/basic.t 2010-07-28 16:07:55 UTC (rev 13434)
+++ Catalyst-Plugin-Params-Nested/trunk/t/basic.t 2010-07-28 21:29:47 UTC (rev 13435)
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 8;
+use Test::More tests => 9;
use Test::MockObject::Extends;
use Test::MockObject;
@@ -34,6 +34,9 @@
$c->prepare_parameters;
is_deeply( $params, { 'foo[bar]' => 1, 'foo' => { bar => 1 } }, "params expanded 1 level deep");
+%$params = ( 'foo[]' => 1 );
+$c->prepare_parameters;
+is_deeply( $params, { 'foo[]' => 1 }, "Empty first-level param not touched");
%$params = ( 'foo[bar][gorch]' => 1 );
$c->prepare_parameters;
More information about the Catalyst-commits
mailing list