Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (20 sloc) 405 Bytes
use strict;
use warnings;
use lib './t';
use Params::Validate qw(validate);
use Test::More;
plan tests => $] == 5.006 ? 2 : 3;
eval { foo() };
like( $@, qr/parameter 'foo'/ );
{
local $Params::Validate::NO_VALIDATION = 1;
eval { foo() };
is( $@, q{} );
}
unless ( $] == 5.006 ) {
eval { foo() };
like( $@, qr/parameter 'foo'/ );
}
sub foo {
validate( @_, { foo => 1 } );
}
Something went wrong with that request. Please try again.