r8758 - in /branches/upstream/libdata-formvalidator-perl/current: Build.PL Changes META.yml Makefile.PL 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:29:07 UTC 2007
Author: gregoa-guest
Date: Fri Nov 2 15:29:06 2007
New Revision: 8758
URL: http://svn.debian.org/wsvn/?sc=1&rev=8758
Log:
[svn-upgrade] Integrating new upstream version, libdata-formvalidator-perl (4.57)
Modified:
branches/upstream/libdata-formvalidator-perl/current/Build.PL
branches/upstream/libdata-formvalidator-perl/current/Changes
branches/upstream/libdata-formvalidator-perl/current/META.yml
branches/upstream/libdata-formvalidator-perl/current/Makefile.PL
branches/upstream/libdata-formvalidator-perl/current/lib/Data/FormValidator.pm
branches/upstream/libdata-formvalidator-perl/current/lib/Data/FormValidator/Constraints.pm
branches/upstream/libdata-formvalidator-perl/current/t/FV_length.t
Modified: branches/upstream/libdata-formvalidator-perl/current/Build.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libdata-formvalidator-perl/current/Build.PL?rev=8758&op=diff
==============================================================================
--- branches/upstream/libdata-formvalidator-perl/current/Build.PL (original)
+++ branches/upstream/libdata-formvalidator-perl/current/Build.PL Fri Nov 2 15:29:06 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: branches/upstream/libdata-formvalidator-perl/current/Changes
URL: http://svn.debian.org/wsvn/branches/upstream/libdata-formvalidator-perl/current/Changes?rev=8758&op=diff
==============================================================================
--- branches/upstream/libdata-formvalidator-perl/current/Changes (original)
+++ branches/upstream/libdata-formvalidator-perl/current/Changes Fri Nov 2 15:29:06 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: branches/upstream/libdata-formvalidator-perl/current/META.yml
URL: http://svn.debian.org/wsvn/branches/upstream/libdata-formvalidator-perl/current/META.yml?rev=8758&op=diff
==============================================================================
--- branches/upstream/libdata-formvalidator-perl/current/META.yml (original)
+++ branches/upstream/libdata-formvalidator-perl/current/META.yml Fri Nov 2 15:29:06 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: branches/upstream/libdata-formvalidator-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/branches/upstream/libdata-formvalidator-perl/current/Makefile.PL?rev=8758&op=diff
==============================================================================
--- branches/upstream/libdata-formvalidator-perl/current/Makefile.PL (original)
+++ branches/upstream/libdata-formvalidator-perl/current/Makefile.PL Fri Nov 2 15:29:06 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: branches/upstream/libdata-formvalidator-perl/current/lib/Data/FormValidator.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libdata-formvalidator-perl/current/lib/Data/FormValidator.pm?rev=8758&op=diff
==============================================================================
--- branches/upstream/libdata-formvalidator-perl/current/lib/Data/FormValidator.pm (original)
+++ branches/upstream/libdata-formvalidator-perl/current/lib/Data/FormValidator.pm Fri Nov 2 15:29:06 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: branches/upstream/libdata-formvalidator-perl/current/lib/Data/FormValidator/Constraints.pm
URL: http://svn.debian.org/wsvn/branches/upstream/libdata-formvalidator-perl/current/lib/Data/FormValidator/Constraints.pm?rev=8758&op=diff
==============================================================================
--- branches/upstream/libdata-formvalidator-perl/current/lib/Data/FormValidator/Constraints.pm (original)
+++ branches/upstream/libdata-formvalidator-perl/current/lib/Data/FormValidator/Constraints.pm Fri Nov 2 15:29:06 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: branches/upstream/libdata-formvalidator-perl/current/t/FV_length.t
URL: http://svn.debian.org/wsvn/branches/upstream/libdata-formvalidator-perl/current/t/FV_length.t?rev=8758&op=diff
==============================================================================
--- branches/upstream/libdata-formvalidator-perl/current/t/FV_length.t (original)
+++ branches/upstream/libdata-formvalidator-perl/current/t/FV_length.t Fri Nov 2 15:29:06 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