BEGIN {
$ENV
{
$_
} = 0
for
qw(
EXTENDED_TESTING
AUTHOR_TESTING
RELEASE_TESTING
PERL_STRICT
)
;
$ENV
{PERL_STRICT} = 1;
};
subtest
"Type constraint object overloading /"
=>
sub
{
my
$type
= ArrayRef[ Int / Str ];
should_pass( [] =>
$type
);
should_pass( [ 1 .. 3 ] =>
$type
);
should_fail( [
"foo"
,
"bar"
] =>
$type
);
should_fail( [ {} ] =>
$type
);
should_fail( {} =>
$type
);
};
subtest
"Type::Parser support for /"
=>
sub
{
my
$type
= t(
'ArrayRef[ Int / Str ]'
);
should_pass( [] =>
$type
);
should_pass( [ 1 .. 3 ] =>
$type
);
should_fail( [
"foo"
,
"bar"
] =>
$type
);
should_fail( [ {} ] =>
$type
);
should_fail( {} =>
$type
);
};
done_testing;