mirror of
https://codeberg.org/scip/Data-Validate-Struct.git
synced 2025-12-17 04:31:01 +01:00
Do not die when comparing hash with array
This commit is contained in:
6
t/run.t
6
t/run.t
@@ -126,7 +126,7 @@ my $cfg = {
|
||||
|
||||
my $v = new_ok('Data::Validate::Struct', [ $ref ]);
|
||||
ok ($v->validate($cfg), "validate a reference against a OK config");
|
||||
|
||||
print STDERR "\n\n\n",$v->errstr(),"\n\n\n";
|
||||
|
||||
|
||||
# check failure matching
|
||||
@@ -401,5 +401,9 @@ my $v4 = Data::Validate::Struct->new({age => 'int'});
|
||||
ok(!$v4->validate({age => 'eight'}), "cache check first run, error");
|
||||
ok($v4->validate({age => 8}), "cache check second run, no error");
|
||||
|
||||
# different references
|
||||
my $v5 = Data::Validate::Struct->new({ foo => [{bar => 'int'}]});
|
||||
ok(!$v5->validate({foo=>{bar=>10}}));
|
||||
|
||||
done_testing();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user