r71171 - in /branches/upstream/libregexp-reggrp-perl/current: Changes lib/Regexp/RegGrp.pm t/01-io.t

emhn-guest at users.alioth.debian.org emhn-guest at users.alioth.debian.org
Fri Mar 11 14:16:07 UTC 2011


Author: emhn-guest
Date: Fri Mar 11 14:15:39 2011
New Revision: 71171

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=71171
Log:
[svn-upgrade] new version libregexp-reggrp-perl (1.000001)

Modified:
    branches/upstream/libregexp-reggrp-perl/current/Changes
    branches/upstream/libregexp-reggrp-perl/current/lib/Regexp/RegGrp.pm
    branches/upstream/libregexp-reggrp-perl/current/t/01-io.t

Modified: branches/upstream/libregexp-reggrp-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libregexp-reggrp-perl/current/Changes?rev=71171&op=diff
==============================================================================
--- branches/upstream/libregexp-reggrp-perl/current/Changes (original)
+++ branches/upstream/libregexp-reggrp-perl/current/Changes Fri Mar 11 14:15:39 2011
@@ -1,4 +1,7 @@
 Revision history for Regexp-RegGrp
+
+1.000001    2011-02-27
+    - Fixed "undefined submatches bug" (Thanks to Dan Thomas).
 
 1.000   2011-01-17
     - Changed versioning.

Modified: branches/upstream/libregexp-reggrp-perl/current/lib/Regexp/RegGrp.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libregexp-reggrp-perl/current/lib/Regexp/RegGrp.pm?rev=71171&op=diff
==============================================================================
--- branches/upstream/libregexp-reggrp-perl/current/lib/Regexp/RegGrp.pm (original)
+++ branches/upstream/libregexp-reggrp-perl/current/lib/Regexp/RegGrp.pm Fri Mar 11 14:15:39 2011
@@ -21,7 +21,7 @@
 
 # =========================================================================== #
 
-our $VERSION = '1.000';
+our $VERSION = '1.000001';
 
 sub new {
     my ( $class, $in_ref )  = @_;
@@ -193,7 +193,7 @@
     my $match       = $match_hash{$match_key};
 
     my @submatches = $match =~ $self->{reggrp}->[$midx]->{regexp};
-    map { $_ ||= ''; } @submatches;
+    map { $_ .= ''; } @submatches;
 
     my $ret = $match;
 
@@ -287,7 +287,7 @@
 
 =head1 VERSION
 
-Version 1.000
+Version 1.000001
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libregexp-reggrp-perl/current/t/01-io.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libregexp-reggrp-perl/current/t/01-io.t?rev=71171&op=diff
==============================================================================
--- branches/upstream/libregexp-reggrp-perl/current/t/01-io.t (original)
+++ branches/upstream/libregexp-reggrp-perl/current/t/01-io.t Fri Mar 11 14:15:39 2011
@@ -40,7 +40,7 @@
             ]
         },
         {
-            description     => 'Simple regexes with sub replacements',
+            description     => 'Simple regexes with sub replacements I',
             input_string    => 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz',
             expected_output => 'bacdefghijklmnopqrstuvwxyYZbacdefghijklmnopqrstuvwxyYZ',
             reggrp      => [
@@ -67,6 +67,22 @@
                         my $match       = $in_ref->{match};
                         my $submatches  = $in_ref->{submatches};
                         return sprintf( "%s%s", $match, $submatches->[0] );
+                    }
+                }
+            ]
+        },
+        {
+            description     => 'Simple regexes with sub replacements II',
+            input_string    => 'a1a2a0a1a0a2a3bcde',
+            expected_output => 'a1a2a0a1a0a2a3bcde',
+            reggrp      => [
+                {
+                    regexp      => qr/(a)(\d)/,
+                    replacement => sub {
+                        my $in_ref      = shift;
+                        my $submatches  = $in_ref->{submatches};
+
+                        return sprintf( "%s%s", $submatches->[0], $submatches->[1] );
                     }
                 }
             ]




More information about the Pkg-perl-cvs-commits mailing list