Branch Coverage

blib/lib/Dios/Types.pm
Criterion Covered Total %
branch 226 310 72.9


line true false branch
26 0 2 if ($export_as and $exportable{$export_as})
32 0 4 unless $exportable{$exported}
55 62 0 if (((&CORE::GLOBAL::caller(0))[3] // '') =~ /\b(?:un)?import\Z/u)
70 62 0 if (((&CORE::GLOBAL::caller(0))[3] // '') =~ /\b(?:un)?import\Z/u)
102 9 2 if (not length $new_type_params) { }
108 4 17 unless $okay
109 4 13 unless &$constraint(local $_ = $_[0])
134 2 7 unless $okay
135 3 4 unless (eval { do { local $SIG{'__WARN__'} = sub { } ; &$constraint(local $_ = $_[0]) } })
159 0 0 $self->[0] ne $self->[-1] ? :
163 73 25 if (&reftype($previous_errors) // '') ne 'ARRAY'
384 18 232 if ($type =~ /\A \s*+ ((?&NON_ATOM_TYPENAME)) \s*+ \Z $FROM_TYPENAME_GRAMMAR /msux)
389 1 0 defined $context ? :
1 249 unless $type =~ /\A \s*+ $TYPENAME_GRAMMAR \s*+ \Z /msux
396 22 227 if (exists $type_is{'conj'})
403 7 32 unless $okay
411 14 213 if (exists $type_is{'disj'})
417 22 21 if &$_($_[0])
424 102 111 if (exists $type_is{'basic'})
427 13 98 if (exists $type_is{'user'})
432 31 2 if (defined $idx)
445 31 67 if (exists $type_is{'array'})
447 2 78 if (&reftype($_[0]) // '') ne 'ARRAY'
451 146 21 if my $okay = &$value_handler($_)
460 3 64 if (exists $type_is{'list'})
462 1 3 if (&reftype($_[0]) // '') ne 'ARRAY'
466 7 0 if my $okay = &$value_handler($_)
474 1 63 if (exists $type_is{'tuple'})
481 0 1 if (@types > 1 and $types[-1] =~ /^$TYPED_ETC$/u) { }
0 1 elsif (@types > 0 and $types[-1] =~ /^$PURE_ETC$/u) { }
497 1 1 if (&reftype($array_ref) // '') ne 'ARRAY' or not $final_handler and @{$array_ref;} != @types
502 0 2 unless $okay
507 1 0 if $final_any or @{$array_ref;} == @types
512 0 0 unless $okay
533 21 42 if (exists $type_is{'hash'})
535 12 9 if (not $arrow) { }
539 4 35 if (&reftype($_[0]) // '') ne 'HASH'
544 4 37 unless $okay
558 0 18 if (&reftype($_[0]) // '') ne 'HASH'
563 7 32 unless $okay
569 2 21 unless $okay
579 2 40 if (exists $type_is{'dict'})
584 4 2 if (exists $+{'keyed'}) { }
588 0 4 if exists $handler_for{$key}
591 4 0 unless $optional
603 1 3 if (&reftype($hash_ref) // '') ne 'HASH'
609 1 4 unless exists $hash_ref->{$key}
614 4 4 if (exists $handler_for{$key}) { }
616 0 4 unless $okay
620 0 4 unless $extra_keys_allowed
631 14 26 if (exists $type_is{'ref'})
632 4 10 if $type_is{'ref'} =~ /$IS_REF_TYPE/u
635 0 26 if not $reftype or $reftype ne 'REF' and $reftype ne 'SCALAR'
638 20 6 $okay ? :
643 2 24 if (exists $type_is{'not'})
646 2 9 if $not_okay
653 0 24 if (exists $type_is{'eq'})
657 0 0 if defined $_[0] and !&blessed($_[0]) || overload::Method($_[0], '""') and eval { do { "$_[0]" eq $str } }
663 6 18 if (exists $type_is{'match'})
665 0 6 if $@
669 22 4 if defined $_[0] and !&blessed($_[0]) || overload::Method($_[0], '""') and eval { do { "$_[0]" =~ /$regex/u } }
675 8 10 if (exists $type_is{'can'})
678 0 8 unless &blessed($_[0]) or $handler_for{'Class'}->($_[0])
681 2 10 unless eval { do { $_[0]->can($method_name) } }
688 10 0 if (exists $type_is{'overloads'})
692 0 10 unless &blessed($_[0]) or $handler_for{'Class'}->($_[0])
694 4 20 unless overload::Method($_[0], $op)
716 60 622 if (ref $arg eq 'CODE') { }
622 0 elsif (defined $arg) { }
730 44 713 unless (exists $handler_for{$typename})
731 0 44 unless $handler_for{$typename} = _build_handler_for($typename)
736 314 442 unless ($handler_for{$typename}->($value))
738 0 314 $value_desc =~ /\s$/u ? :
742 384 58 unless @constraints
749 33 25 unless (eval { do { local $SIG{'__WARN__'} = sub { } ; &$test(local $_ = $value) } })
752 0 33 $value_desc =~ /\s$/u ? :
766 50 116 if (ref $arg eq 'CODE') { }
116 0 elsif (defined $arg) { }
780 2 116 unless (exists $handler_for{$typename})
781 0 2 unless $handler_for{$typename} = _build_handler_for($typename)
786 13 105 unless ($handler_for{$typename}->($value))
788 7 6 $value_desc =~ /\s$/u ? :
792 63 42 unless @constraints
799 4 38 unless (eval { do { local $SIG{'__WARN__'} = sub { } ; &$test(local $_ = $value) } })
802 0 4 $value_desc =~ /\s$/u ? :
816 1 167 if (ref $arg eq 'CODE') { }
167 0 elsif (defined $arg) { }
830 43 238 unless (exists $handler_for{$typename})
831 0 43 unless $handler_for{$typename} = _build_handler_for($typename)
838 114 0 unless $value_desc or @constraints
841 46 152 if &$handler($_[0])
844 0 152 $desc =~ /\s$/u ? :
847 166 1 unless @constraints
851 2 8 unless ($handler_for{$typename}->($_[0]))
853 0 2 $desc =~ /\s$/u ? :
857 0 8 unless @constraints
864 0 8 unless (eval { do { local $SIG{'__WARN__'} = sub { } ; &$test(local $_ = $_[0]) } })
867 0 0 $desc =~ /\s$/u ? :
888 0 0 @{$_[0];} > 1 ? :
900 0 0 @_ ? :
901 0 0 if $off < 0
902 0 0 @_ ? :
927 21 30 if ($vartype ne 'ARRAY' and $vartype ne 'HASH') { }
15 15 elsif ($vartype eq 'ARRAY') { }
15 0 elsif ($vartype eq 'HASH') { }
929 0 21 unless eval { do { require Variable::Magic } }
933 19 23 if ((&CORE::GLOBAL::caller(3))[3] // '') eq 'Object::InsideOut::DESTROY'
938 19 4 if eval { do { _up_validate(2, $type, ${$_[0];}, $value_desc, @constraint) } }
947 7 8 if tied @{$varref;}
951 7 8 if tied %{$varref;}
968 1 32 if (wantarray) { }
30 2 elsif (defined wantarray) { }
972 0 1 if $void_warning and $type eq 'Void'
981 0 3 unless &$where($_)
988 0 1 if (@retvals == 1) { }
1018 0 30 if $void_warning and $type eq 'Void'
1048 0 2 if $void_warning and not eval { do { _up_validate(1, $type, undef) } }
1061 26 110 if $type_a eq $type_b
1064 24 86 if (not $unnormalized and $type_a =~ /\A (?: Ref ) \Z /msux) { }
0 86 elsif (not $unnormalized and $type_a =~ /\A (?: Array | List ) \Z /msux) { }
4 82 elsif (not $unnormalized and $type_a eq 'Hash') { }
0 82 elsif ($type_a =~ /\A \s*+ ((?&NON_ATOM_TYPENAME)) \s*+ \Z $FROM_TYPENAME_GRAMMAR /msux) { }
1078 0 110 if (not $unnormalized and $type_b =~ /\A (?: Ref ) \Z /msux) { }
0 110 elsif (not $unnormalized and $type_b =~ /\A (?: Array | List ) \Z /msux) { }
20 90 elsif (not $unnormalized and $type_b eq 'Hash') { }
0 90 elsif ($type_b =~ /\A \s*+ ((?&NON_ATOM_TYPENAME)) \s*+ \Z $FROM_TYPENAME_GRAMMAR /msux) { }
1093 62 20 if (exists $type_a_is{'basic'} and exists $type_b_is{'basic'})
1094 32 30 if $BASIC_NARROWER{$type_b}{$type_a}
1095 30 0 if $BASIC_NARROWER{$type_a}{$type_b}
1100 16 12 if (exists $type_a_is{$elem_type} and exists $type_b_is{$elem_type})
1106 32 0 if ($type_a =~ s/\A(?:List|Array|Hash|Ref|Match|Eq)\K\[.*//msux or $type_b =~ s/\A(?:List|Array|Hash|Ref|Match|Eq)\K\[.*//msux)
1108 0 0 if $type_a =~ /\A(?:Match|Eq)\Z/u and $BASIC_NARROWER{'Class'}{$type_b}
1109 0 0 if $type_b =~ /\A(?:Match|Eq)\Z/u and $BASIC_NARROWER{'Class'}{$type_a}
1114 0 0 if (exists $type_a_is{'user'} and exists $type_b_is{'user'})
1115 0 0 if $type_b->isa($type_a)
1116 0 0 if $type_a->isa($type_b)
1130 16 18 $_->{'named'} ? :
1138 42 46 $sig_a_name ? :
1145 26 62 if (not $is_narrower and $type_a eq $type_b)
1148 0 26 $where_a < $where_b ? :
0 26 $where_a > $where_b ? :
1154 16 72 if $is_narrower and $is_narrower == -$partial_ordering
1181 35 56 if ($narrowness < 0) { }
24 32 elsif ($narrowness > 0) { }
1190 6 21 if ($max_narrower < @sigs - 1) { }
1199 4 23 if ($kind eq 'method' and @sigs > 1)
1202 2 0 $Dios::Types::b->{'class'}->isa($Dios::Types::a->{'class'}) ? :
0 2 $Dios::Types::a->{'class'}->isa($Dios::Types::b->{'class'}) ? :
2 2 $Dios::Types::a->{'class'} eq $Dios::Types::b->{'class'} ? :
1216 0 40 if ($constraint_desc)
1224 40 0 if (not length($constraint_desc // '') and eval { do { require B } })
1226 0 40 if ($sub_name and $sub_name ne '__ANON__')
1233 40 0 if (not length($constraint_desc // '') and eval { do { require B::Deparse } })
1252 0 1473 if (my $tiedclass = tied $_) { }
2 1471 elsif (my $classname = &blessed($_)) { }