TUWF
view release on metacpan or search on metacpan
t/validate.t view on Meta::CPAN
name => {},
age => { missing => 'ignore' },
sex => { missing => 'reject', default => 1 }
}
},
);
sub t {
my($schema, $input, $output, $error) = @_;
my $line = (caller)[2];
my $schema_copy = dclone([$schema])->[0];
my $input_copy = dclone([$input])->[0];
my $res = validate \%validations, $schema, $input;
#diag explain $res if $line == 82;
is !!$res, !$error, "boolean context $line";
is_deeply $schema, $schema_copy, "schema modification $line";
is_deeply $input, $input_copy, "input modification $line";
is_deeply $res->unsafe_data(), $output, "unsafe_data $line";
( run in 1.430 second using v1.01-cache-2.11-cpan-a3c8064c92c )