use
lib
qw( ./lib ./t/lib ../inc ./inc )
;
like(
exception { Type::Tiny::Enum->new(
parent
=> Int) },
qr/^Enum type constraints cannot have a parent constraint/
,
);
like(
exception { Type::Tiny::Enum->new(
constraint
=>
sub
{ 1 }) },
qr/^Enum type constraints cannot have a constraint coderef/
,
);
like(
exception { Type::Tiny::Enum->new(
inlined
=>
sub
{ 1 }) },
qr/^Enum type constraints cannot have a inlining coderef/
,
);
like(
exception { Type::Tiny::Enum->new() },
qr/^Need to supply list of values/
,
);
ok(
!exception { Type::Tiny::Enum->new(
values
=> [
qw/foo bar/
]) },
);
done_testing;