use
lib
qw( ./lib ./t/lib ../inc ./inc )
;
BEGIN {
Type::Tiny::SUPPORT_SMARTMATCH
or plan
skip_all
=>
'smartmatch support not available for this version or Perl'
;
}
no
warnings;
ok( 42 ~~ Int );
ok( 42 ~~ Num );
ok not( 42 ~~ ArrayRef );
ok( 42 ~~ \
&is_Int
);
ok not( 42 ~~ \
&is_ArrayRef
);
TODO: {
given
(4) {
when
( \
&is_RegexpRef
) { fail(
'regexpref'
) }
when
( \
&is_Int
) { pass(
'int'
) }
default
{ fail(
'default'
) }
}
local
$TODO
=
'this would be nice, but probably requires changes to perl'
;
given
(4) {
when
( RegexpRef ) { fail(
'regexpref'
) }
when
( Int ) { pass(
'int'
) }
default
{ fail(
'default'
) }
}
};
done_testing;