mirror of
https://codeberg.org/scip/Data-Validate-Struct.git
synced 2025-12-17 04:31:01 +01:00
fixed cached errors bug
This commit is contained in:
@@ -21,7 +21,7 @@ use File::stat;
|
||||
use Data::Validate qw(:math is_printable);
|
||||
use Data::Validate::IP qw(is_ipv4 is_ipv6);
|
||||
|
||||
our $VERSION = 0.08;
|
||||
our $VERSION = 0.09;
|
||||
|
||||
use vars qw(@ISA);
|
||||
|
||||
@@ -128,7 +128,6 @@ sub new {
|
||||
# types from here and use Data::Validate's methods as subroutine
|
||||
# checks, which we already support.
|
||||
$self->{types} = \%__ValidatorTypes;
|
||||
|
||||
$self->{debug} = 0;
|
||||
$self->{errors} = [];
|
||||
|
||||
@@ -175,6 +174,9 @@ sub type {
|
||||
sub validate {
|
||||
my ($self, $config) = @_;
|
||||
|
||||
# reset errors in case it's a repeated run
|
||||
$self->{errors} = [];
|
||||
|
||||
$self->_traverse($self->{structure}, $config, ());
|
||||
# return TRUE if no errors
|
||||
return scalar @{ $self->{errors} } == 0;
|
||||
@@ -884,7 +886,7 @@ Thanks to David Cantrell for his helpful hints.
|
||||
|
||||
=head1 VERSION
|
||||
|
||||
0.08
|
||||
0.09
|
||||
|
||||
=cut
|
||||
|
||||
|
||||
Reference in New Issue
Block a user