r4292 - in
/packages/libformvalidator-simple-perl/branches/upstream/current:
Changes MANIFEST META.yml lib/FormValidator/Simple.pm
lib/FormValidator/Simple/Results.pm t/27_set_invalid.t
gregoa-guest at users.alioth.debian.org
gregoa-guest at users.alioth.debian.org
Sun Nov 19 20:00:28 CET 2006
Author: gregoa-guest
Date: Sun Nov 19 20:00:27 2006
New Revision: 4292
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=4292
Log:
Load /tmp/tmp.KHJrp29221/libformvalidator-simple-perl-0.19 into
packages/libformvalidator-simple-perl/branches/upstream/current.
Added:
packages/libformvalidator-simple-perl/branches/upstream/current/t/27_set_invalid.t
Modified:
packages/libformvalidator-simple-perl/branches/upstream/current/Changes
packages/libformvalidator-simple-perl/branches/upstream/current/MANIFEST
packages/libformvalidator-simple-perl/branches/upstream/current/META.yml
packages/libformvalidator-simple-perl/branches/upstream/current/lib/FormValidator/Simple.pm
packages/libformvalidator-simple-perl/branches/upstream/current/lib/FormValidator/Simple/Results.pm
Modified: packages/libformvalidator-simple-perl/branches/upstream/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libformvalidator-simple-perl/branches/upstream/current/Changes?rev=4292&op=diff
==============================================================================
--- packages/libformvalidator-simple-perl/branches/upstream/current/Changes (original)
+++ packages/libformvalidator-simple-perl/branches/upstream/current/Changes Sun Nov 19 20:00:27 2006
@@ -1,4 +1,9 @@
Revision history for Perl extension FormValidator::Simple.
+
+0.19 Thu Oct 26 18:52:00 2006
+ - Added set_invalid method to Results class.
+ This function is described in POD, but didn't work.
+ Applied a patche from IKEBE Tomohiro. Thanks!
0.18 Tue Sep 12 18:20:00 2006
- bugfix:
Modified: packages/libformvalidator-simple-perl/branches/upstream/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libformvalidator-simple-perl/branches/upstream/current/MANIFEST?rev=4292&op=diff
==============================================================================
--- packages/libformvalidator-simple-perl/branches/upstream/current/MANIFEST (original)
+++ packages/libformvalidator-simple-perl/branches/upstream/current/MANIFEST Sun Nov 19 20:00:27 2006
@@ -43,5 +43,6 @@
t/24_options.t
t/25_all.t
t/26_inarray.t
+t/27_set_invalid.t
t/conf/messages.yml
t/lib/FormValidator/Simple/Plugin/Sample.pm
Modified: packages/libformvalidator-simple-perl/branches/upstream/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libformvalidator-simple-perl/branches/upstream/current/META.yml?rev=4292&op=diff
==============================================================================
--- packages/libformvalidator-simple-perl/branches/upstream/current/META.yml (original)
+++ packages/libformvalidator-simple-perl/branches/upstream/current/META.yml Sun Nov 19 20:00:27 2006
@@ -1,7 +1,7 @@
# http://module-build.sourceforge.net/META-spec.html
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: FormValidator-Simple
-version: 0.18
+version: 0.19
version_from: lib/FormValidator/Simple.pm
installdirs: site
requires:
Modified: packages/libformvalidator-simple-perl/branches/upstream/current/lib/FormValidator/Simple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libformvalidator-simple-perl/branches/upstream/current/lib/FormValidator/Simple.pm?rev=4292&op=diff
==============================================================================
--- packages/libformvalidator-simple-perl/branches/upstream/current/lib/FormValidator/Simple.pm (original)
+++ packages/libformvalidator-simple-perl/branches/upstream/current/lib/FormValidator/Simple.pm Sun Nov 19 20:00:27 2006
@@ -12,7 +12,7 @@
use FormValidator::Simple::Constants;
use FormValidator::Simple::Messages;
-our $VERSION = '0.18';
+our $VERSION = '0.19';
__PACKAGE__->mk_classaccessors(qw/data prof results/);
__PACKAGE__->mk_classaccessor( messages => FormValidator::Simple::Messages->new );
Modified: packages/libformvalidator-simple-perl/branches/upstream/current/lib/FormValidator/Simple/Results.pm
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libformvalidator-simple-perl/branches/upstream/current/lib/FormValidator/Simple/Results.pm?rev=4292&op=diff
==============================================================================
--- packages/libformvalidator-simple-perl/branches/upstream/current/lib/FormValidator/Simple/Results.pm (original)
+++ packages/libformvalidator-simple-perl/branches/upstream/current/lib/FormValidator/Simple/Results.pm Sun Nov 19 20:00:27 2006
@@ -60,6 +60,16 @@
$self->record($name)->set($type, $result);
}
+sub set_invalid {
+ my ($self, $name, $type) = @_;
+ unless ($name && $type) {
+ FormValidator::Simple::Exception->throw(
+ qq/set_invalid needs two arguments./
+ );
+ }
+ $self->set_result($name, $type, FALSE);
+}
+
sub success {
my $self = shift;
return ($self->has_missing or $self->has_invalid) ? FALSE : TRUE;
Added: packages/libformvalidator-simple-perl/branches/upstream/current/t/27_set_invalid.t
URL: http://svn.debian.org/wsvn/pkg-perl/packages/libformvalidator-simple-perl/branches/upstream/current/t/27_set_invalid.t?rev=4292&op=file
==============================================================================
--- packages/libformvalidator-simple-perl/branches/upstream/current/t/27_set_invalid.t (added)
+++ packages/libformvalidator-simple-perl/branches/upstream/current/t/27_set_invalid.t Sun Nov 19 20:00:27 2006
@@ -1,0 +1,21 @@
+use strict;
+use Test::More tests => 6;
+use CGI;
+
+BEGIN { use_ok("FormValidator::Simple"); }
+
+my $q = CGI->new;
+$q->param(foo => 'FooBarBaz');
+
+my $results = FormValidator::Simple->check( $q, [
+ foo => [qw/NOT_BLANK/],
+] );
+ok($results->valid('foo'));
+ok(!$results->invalid('foo'));
+
+$results->set_invalid(foo => 'ANOTHER_CONSTRAINT');
+
+ok(!$results->valid('foo'));
+ok($results->invalid('foo'));
+ok($results->invalid('foo', 'ANOTHER_CONSTRAINT'));
+
More information about the Pkg-perl-cvs-commits
mailing list