Do not die when comparing hash with array

This commit is contained in:
Alberto Simões
2023-02-01 20:17:58 +00:00
parent f407cf9737
commit 8af39de413
3 changed files with 18 additions and 5 deletions

View File

@@ -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();