use
strict;
use
warnings;
use
Test::More;
type
Message
=> Str &
sub
{
length
(
$_
) > 1 };
sub
hello {
args
my
$message
=> Message;
return
"HELLO "
.
$message
;
}
is hello(
message
=>
'World'
),
'HELLO World'
;
eval
{ hello(
message
=>
''
) };
ok $@,
'invalid message'
;
done_testing;