added check for not caching errors

This commit is contained in:
git@daemon.de
2014-12-02 08:43:16 +01:00
parent fb50f16742
commit 1f7d648943

View File

@@ -395,5 +395,11 @@ $v3->type(noob => sub { return $_[0] == 42 });
ok($v3->validate($cfg3), "using custom types");
# check if errors are not cached
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");
done_testing();