r8760 - in /trunk/libdata-formvalidator-perl: Build.PL Changes META.yml Makefile.PL debian/changelog lib/Data/FormValidator.pm lib/Data/FormValidator/Constraints.pm t/FV_length.t

gregoa-guest at users.alioth.debian.org gregoa-guest at users.alioth.debian.org
Fri Nov 2 15:30:38 UTC 2007


Author: gregoa-guest
Date: Fri Nov  2 15:30:37 2007
New Revision: 8760

URL: http://svn.debian.org/wsvn/?sc=1&rev=8760
Log:
New upstream release.

Modified:
    trunk/libdata-formvalidator-perl/Build.PL
    trunk/libdata-formvalidator-perl/Changes
    trunk/libdata-formvalidator-perl/META.yml
    trunk/libdata-formvalidator-perl/Makefile.PL
    trunk/libdata-formvalidator-perl/debian/changelog
    trunk/libdata-formvalidator-perl/lib/Data/FormValidator.pm
    trunk/libdata-formvalidator-perl/lib/Data/FormValidator/Constraints.pm
    trunk/libdata-formvalidator-perl/t/FV_length.t

Modified: trunk/libdata-formvalidator-perl/Build.PL
URL: http://svn.debian.org/wsvn/trunk/libdata-formvalidator-perl/Build.PL?rev=8760&op=diff
==============================================================================
--- trunk/libdata-formvalidator-perl/Build.PL (original)
+++ trunk/libdata-formvalidator-perl/Build.PL Fri Nov  2 15:30:37 2007
@@ -29,7 +29,9 @@
 
 
 $class->new(
-    create_makefile_pl  => 'traditional', 
+    # Makefile.PL is maintained manually now because the 5.8 requirement wasn't getting
+    # translated automatically. 
+    # create_makefile_pl  => 'traditional', 
     dist_author         => 'Mark Stosberg <mark at summersault.com>',
 	module_name => 'Data::FormValidator',
 	license => 'perl',

Modified: trunk/libdata-formvalidator-perl/Changes
URL: http://svn.debian.org/wsvn/trunk/libdata-formvalidator-perl/Changes?rev=8760&op=diff
==============================================================================
--- trunk/libdata-formvalidator-perl/Changes (original)
+++ trunk/libdata-formvalidator-perl/Changes Fri Nov  2 15:30:37 2007
@@ -1,3 +1,13 @@
+4.57 Thu Nov  1 22:47:13 EDT 2007
+    [BUG FIXES]
+    - The min max and length_between constraints now allow multi-line input, 
+      Thanks to Carl Vincent. RT##30221. If we had only used the Regex style
+      prescribed by the Perl Best Practices book in the first place, this
+      wouldn't have been a problem!
+
+    [INTERNALS]
+    - Makefile.PL to updated to explicitly require 5.008;
+    - Fix doc link to "Old School Constraints", thanks to rjbs.    
 
 4.56 Wed Oct 31 12:34:32 EDT 2007
     [INTERNALS]

Modified: trunk/libdata-formvalidator-perl/META.yml
URL: http://svn.debian.org/wsvn/trunk/libdata-formvalidator-perl/META.yml?rev=8760&op=diff
==============================================================================
--- trunk/libdata-formvalidator-perl/META.yml (original)
+++ trunk/libdata-formvalidator-perl/META.yml Fri Nov  2 15:30:37 2007
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name: Data-FormValidator
-version: 4.56
+version: 4.57
 author:
   - Mark Stosberg <mark at summersault.com>
 abstract: |-
@@ -21,7 +21,7 @@
 provides:
   Data::FormValidator:
     file: lib/Data/FormValidator.pm
-    version: 4.56
+    version: 4.57
   Data::FormValidator::Constraints:
     file: lib/Data/FormValidator/Constraints.pm
     version: 4.51

Modified: trunk/libdata-formvalidator-perl/Makefile.PL
URL: http://svn.debian.org/wsvn/trunk/libdata-formvalidator-perl/Makefile.PL?rev=8760&op=diff
==============================================================================
--- trunk/libdata-formvalidator-perl/Makefile.PL (original)
+++ trunk/libdata-formvalidator-perl/Makefile.PL Fri Nov  2 15:30:37 2007
@@ -1,4 +1,4 @@
-# Note: this file was auto-generated by Module::Build::Compat version 0.03
+use 5.008; # patches to fix tests failing on 5.6 are welcome. 
 use ExtUtils::MakeMaker;
 WriteMakefile
 (

Modified: trunk/libdata-formvalidator-perl/debian/changelog
URL: http://svn.debian.org/wsvn/trunk/libdata-formvalidator-perl/debian/changelog?rev=8760&op=diff
==============================================================================
--- trunk/libdata-formvalidator-perl/debian/changelog (original)
+++ trunk/libdata-formvalidator-perl/debian/changelog Fri Nov  2 15:30:37 2007
@@ -1,3 +1,9 @@
+libdata-formvalidator-perl (4.57-1) UNRELEASED; urgency=low
+
+  * New upstream release.
+
+ -- gregor herrmann <gregor+debian at comodo.priv.at>  Fri, 02 Nov 2007 16:29:06 +0100
+
 libdata-formvalidator-perl (4.56-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/libdata-formvalidator-perl/lib/Data/FormValidator.pm
URL: http://svn.debian.org/wsvn/trunk/libdata-formvalidator-perl/lib/Data/FormValidator.pm?rev=8760&op=diff
==============================================================================
--- trunk/libdata-formvalidator-perl/lib/Data/FormValidator.pm (original)
+++ trunk/libdata-formvalidator-perl/lib/Data/FormValidator.pm Fri Nov  2 15:30:37 2007
@@ -33,7 +33,7 @@
 
 use vars qw( $VERSION $AUTOLOAD @ISA @EXPORT_OK %EXPORT_TAGS );
 
-$VERSION = '4.56';
+$VERSION = '4.57';
 
 require Exporter;
 @ISA = qw(Exporter);

Modified: trunk/libdata-formvalidator-perl/lib/Data/FormValidator/Constraints.pm
URL: http://svn.debian.org/wsvn/trunk/libdata-formvalidator-perl/lib/Data/FormValidator/Constraints.pm?rev=8760&op=diff
==============================================================================
--- trunk/libdata-formvalidator-perl/lib/Data/FormValidator/Constraints.pm (original)
+++ trunk/libdata-formvalidator-perl/lib/Data/FormValidator/Constraints.pm Fri Nov  2 15:30:37 2007
@@ -275,7 +275,7 @@
     return sub {
         my ($dfv,$value) = @_;
         $dfv->name_this('length_between');
-        my ($match) = ($value =~ m/^(.{$min,$max})$/);
+        my ($match) = ($value =~ m/\A(.{$min,$max})\z/xms);
         return $dfv->untainted_constraint_value($match);
     }
 }
@@ -286,7 +286,7 @@
     return sub {
         my ($dfv,$value) = @_;
         $dfv->name_this('max_length');
-        my ($match) = ($value =~ m/^(.{0,$max}$)/);
+        my ($match) = ($value =~ m/\A(.{0,$max})\z/xms);
         return $dfv->untainted_constraint_value($match);
     }
 }
@@ -297,7 +297,7 @@
     return sub {
         my ($dfv,$value) = @_;
         $dfv->name_this('min_length');
-        my ($match) = ($value =~ m/^(.{$min,})$/);
+        my ($match) = ($value =~ m/\A(.{$min,})\z/xms);
         return $dfv->untainted_constraint_value($match);
     }
 }
@@ -724,8 +724,7 @@
 
 =head2 New School Constraints Overview
 
-This is the current recommended way to write constraints. See also L<Old School
-Constraints>.
+This is the current recommended way to write constraints. See also L<Old School Constraints>.
 
 The most flexible way to create constraints to use closures-- a normal seeming
 outer subroutine which returns a customized DFV method subroutine as a result.
@@ -775,6 +774,7 @@
 	}
   }
 
+=head2 Old School Constraints
 
 Here is documentation on how old school constraints are created. These are
 supported, but the the new school style documented above is recommended. 

Modified: trunk/libdata-formvalidator-perl/t/FV_length.t
URL: http://svn.debian.org/wsvn/trunk/libdata-formvalidator-perl/t/FV_length.t?rev=8760&op=diff
==============================================================================
--- trunk/libdata-formvalidator-perl/t/FV_length.t (original)
+++ trunk/libdata-formvalidator-perl/t/FV_length.t Fri Nov  2 15:30:37 2007
@@ -38,4 +38,36 @@
 
 ok(defined $result);
 
+# Test multi-line input: someone might be using this for a textarea or somesuch
 
+my $multiline_result = Data::FormValidator->check(
+    {
+        alpha   => "apple\naeroplane\n",      # 16 char
+        beta    => "bus\nbuffalo\n",          # 12 char
+        charlie => "cat\ncoconut\ncoffee\n",  # 19 char
+        delta   => "dog\ndinosaur\n",         # 13 char
+        echo    => "egg\nelephant\nemu\n",    # 17 char
+        foxtrot => "flan\nfrog\n",            # 10 char
+        golf    => "giraffe\ngrapefruit\n",   # 19 char
+    },
+    {
+        required => [qw/alpha beta charlie delta echo foxtrot golf/],
+        constraint_methods => {
+            alpha   => FV_max_length(16),           # max length
+            beta    => FV_max_length(11),           # too long
+            charlie => FV_min_length(19),           # just long enough
+            delta   => FV_min_length(14),           # too short
+            echo    => FV_length_between(16,18),    # just right 
+            foxtrot => FV_length_between(11,13),    # too short
+            golf    => FV_length_between(16,18),    # too long
+        },
+    },
+);
+
+ok( $multiline_result->valid('alpha'),     'multiline FV_max_length in bounds'    );
+ok( $multiline_result->invalid('beta'),    'multiline FV_max_length too long'     );
+ok( $multiline_result->valid('charlie'),   'multiline FV_min_length in bounds'    );
+ok( $multiline_result->invalid('delta'),   'multiline FV_min_length too short'    );
+ok( $multiline_result->valid('echo'),      'multiline FV_length_between in bounds');
+ok( $multiline_result->invalid('foxtrot'), 'multiline FV_length_between too short');
+ok( $multiline_result->invalid('golf'),    'multiline FV_length_between too long' );




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