From 1f7d648943e5a4c53919c4a900e4a88410515458 Mon Sep 17 00:00:00 2001 From: "git@daemon.de" Date: Tue, 2 Dec 2014 08:43:16 +0100 Subject: [PATCH] added check for not caching errors --- t/run.t | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/run.t b/t/run.t index 383678f..b689dfa 100644 --- a/t/run.t +++ b/t/run.t @@ -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();