Branch Coverage

blib/lib/Types/TypeTiny.pm
Criterion Covered Total %
branch 116 222 52.2


line true false branch
21 273 0 eval { do { require Type::Tiny::XS; 'Type::Tiny::XS'->VERSION('0.022'); 1 } } ? :
44 1 34 unless @_ > 1
51 0 34 ref $_[0] ? :
78 1 114 unless $INC{'Type/Tiny.pm'}
97 1 757 unless $self->has_type(@_)
113 1 0 unless $self->has_coercion(@_)
141 81 0 if (ref $package)
143 0 81 unless defined $package
149 23 70 if defined &{$fqmeth;}
155 241 0 if ($Type::Tiny::AvoidCallbacks)
163 132 248 if defined $cache{'StringLike'}
169 41 14 unless defined $_ and not ref $_
187 55 304 $Type::Tiny::AvoidCallbacks || !$xsubname ? :
200 76 117 if defined $cache{'HashLike'} and not @_
206 58 7 unless ref $_ eq "HASH"
218 2 0 defined $paramname ? :
221 2 0 if $xsub
226 0 0 unless &$check($hash{$key})
233 0 2 unless $param->can_be_inlined
238 2 0 defined $paramname ? :
244 13 10 if $xsubname and not $Type::Tiny::AvoidCallbacks
255 0 1 unless $param->has_coercion
260 4 0 @_ ? :
264 2 6 unless &$coercible($orig{$k})
283 65 174 $Type::Tiny::AvoidCallbacks || !$xsubname ? :
294 2 115 @_ ? :
298 76 118 if defined $cache{'ArrayLike'} and not @_
304 56 9 unless ref $_ eq "ARRAY"
316 2 0 defined $paramname ? :
319 2 0 if $xsub
324 0 0 unless &$check($val)
331 0 2 unless $param->can_be_inlined
336 2 0 defined $paramname ? :
342 13 10 if $xsubname and not $Type::Tiny::AvoidCallbacks
353 0 1 unless $param->has_coercion
358 4 0 @_ ? :
362 2 8 unless &$coercible($v)
381 65 175 $Type::Tiny::AvoidCallbacks || !$xsubname ? :
392 2 116 @_ ? :
400 78 121 if $cache{'CodeLike'}
405 54 2 unless ref $_ eq "CODE"
424 56 178 $Type::Tiny::AvoidCallbacks || !$xsubname ? :
437 126569 249 if defined $cache{'TypeTiny'}
441 18 38 if &blessed($_)
457 89 114 if defined $cache{'_ForeignTypeConstraint'}
472 200 0 @_ ? :
473 6 194 if ref $t eq "CODE"
474 80 114 if (my $class = &blessed($t))
475 0 80 if $class->isa("Type::Tiny")
476 0 80 if $class->isa("Moose::Meta::TypeConstraint")
477 0 80 if $class->isa("MooseX::Types::TypeDecorator")
478 0 80 if $class->isa("Validation::Class::Simple")
479 0 80 if $class->isa("Validation::Class")
480 5 75 if $t->can("check")
486 144626 0 @_ ? :
488 1109 143517 unless my $ref = ref $t
489 103425 40092 if $ref =~ /^Type::Tiny\b/
491 0 40092 if $ttt_cache{&refaddr($t)}
494 50 40042 if (my $class = &blessed($t))
495 0 50 if $class->isa("Type::Tiny")
496 0 50 if $class eq "MooseX::Types::TypeDecorator"
497 0 50 if $class->isa("Moose::Meta::TypeConstraint")
498 0 50 if $class->isa("MooseX::Types::TypeDecorator")
499 0 50 if $class->isa("Mouse::Meta::TypeConstraint")
500 0 50 if $class->isa("Validation::Class::Simple")
501 0 50 if $class->isa("Validation::Class")
502 6 44 if $t->can("DOES") and $t->DOES("Type::Library::Compiler::TypeConstraint") and $t->can("to_TypeTiny")
503 3 41 if $t->can("check")
507 40019 64 if $ref eq "CODE"
515 0 0 if (ref $t->{'Types::TypeTiny::to_TypeTiny'})
519 0 0 if ($t->name ne "__ANON__")
522 0 0 if $ts->{'_is_core'}
526 0 0 $t->isa('Moose::Meta::TypeConstraint::DuckType') ? :
0 0 $t->isa('Moose::Meta::TypeConstraint::Union') ? :
0 0 $t->isa('Moose::Meta::TypeConstraint::Role') ? :
0 0 $t->isa('Moose::Meta::TypeConstraint::Class') ? :
0 0 $t->isa('Moose::Meta::TypeConstraint::Enum') ? :
0 0 $t->can('parameterize') ? :
541 0 0 if $t->has_message
547 0 0 if $t->has_coercion
561 0 0 if $t->has_parent
564 0 0 if $t->can("can_be_inlined") and $t->can_be_inlined
567 0 0 if ($opts{'inlined'})
568 0 0 unless $t->inline_environment
569 0 0 if keys %env
613 0 0 is_TypeTiny($_) ? :
630 0 0 if ($t->VERSION >= '7.900048') { }
645 0 0 eval { do { $t->validate } } ? :
664 0 0 eval { do { $t->validate } } ? :
674 0 0 unless $t->get_fields($k)
691 30 0 @_ ? :
694 2 0 @_ ? :
695 3 0 if $t->can("get_message")
697 0 3 if $t->can("name")
699 1 0 @_ ? :
700 1 0 if $t->can("has_coercion") and $t->has_coercion and $t->can("coerce")
704 0 0 if ($t->can("can_be_inlined") and $t->can_be_inlined and $t->can("inline_check"))
722 0 0 @_ ? :
723 0 0 @_ ? :
726 0 0 if $t->can("name")
728 0 0 @_ ? :
729 0 0 if $t->can("has_coercion") and $t->has_coercion and $t->can("coerce")
733 0 0 if ($t->{'constraint_generator'})
737 0 0 is_TypeTiny($_) ? :
760 1 0 if $@
1 1 unless (eval { do { &$t($_); 1 } })
765 1 40018 if ($QFS ||= "Sub::Quote"->can("quoted_from_sub"))
766 0 1 unless &$QFS($t)
767 1 0 if ($perlstring)
771 0 11 $var eq '$_' ? :
778 1 0 if $perlstring and not $captures