blib/lib/Dios/Types.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
condition | 113 | 196 | 57.6 |
line | !l | l&&!r | l&&r | condition |
---|---|---|---|---|
26 | 2 | 2 | 0 | $export_as and $exportable{$export_as} |
481 | 0 | 1 | 0 | @types > 1 and $types[-1] =~ /^$TYPED_ETC$/u |
0 | 1 | 0 | @types > 0 and $types[-1] =~ /^$PURE_ETC$/u | |
497 | 0 | 1 | 0 | not $final_handler and @{$array_ref;} != @types |
635 | 2 | 24 | 0 | $reftype ne 'REF' and $reftype ne 'SCALAR' |
657 | 0 | 0 | 0 | defined $_[0] and !&blessed($_[0]) || overload::Method($_[0], '""') |
0 | 0 | 0 | defined $_[0] and !&blessed($_[0]) || overload::Method($_[0], '""') and eval { do { "$_[0]" eq $str } } | |
669 | 0 | 0 | 26 | defined $_[0] and !&blessed($_[0]) || overload::Method($_[0], '""') |
0 | 4 | 22 | defined $_[0] and !&blessed($_[0]) || overload::Method($_[0], '""') and eval { do { "$_[0]" =~ /$regex/u } } | |
927 | 15 | 15 | 21 | $vartype ne 'ARRAY' and $vartype ne 'HASH' |
972 | 0 | 1 | 0 | $void_warning and $type eq 'Void' |
1018 | 0 | 30 | 0 | $void_warning and $type eq 'Void' |
1048 | 0 | 2 | 0 | $void_warning and not eval { do { _up_validate(1, $type, undef) } } |
1064 | 48 | 38 | 24 | not $unnormalized and $type_a =~ /\A (?: Ref ) \Z /msux |
48 | 38 | 0 | not $unnormalized and $type_a =~ /\A (?: Array | List ) \Z /msux | |
48 | 34 | 4 | not $unnormalized and $type_a eq 'Hash' | |
1078 | 48 | 62 | 0 | not $unnormalized and $type_b =~ /\A (?: Ref ) \Z /msux |
48 | 62 | 0 | not $unnormalized and $type_b =~ /\A (?: Array | List ) \Z /msux | |
48 | 42 | 20 | not $unnormalized and $type_b eq 'Hash' | |
1093 | 28 | 20 | 62 | exists $type_a_is{'basic'} and exists $type_b_is{'basic'} |
1100 | 116 | 12 | 16 | exists $type_a_is{$elem_type} and exists $type_b_is{$elem_type} |
1108 | 32 | 0 | 0 | $type_a =~ /\A(?:Match|Eq)\Z/u and $BASIC_NARROWER{'Class'}{$type_b} |
1109 | 32 | 0 | 0 | $type_b =~ /\A(?:Match|Eq)\Z/u and $BASIC_NARROWER{'Class'}{$type_a} |
1114 | 0 | 0 | 0 | exists $type_a_is{'user'} and exists $type_b_is{'user'} |
1145 | 62 | 0 | 26 | not $is_narrower and $type_a eq $type_b |
1154 | 26 | 46 | 16 | $is_narrower and $is_narrower == -$partial_ordering |
1199 | 15 | 8 | 4 | $kind eq 'method' and @sigs > 1 |
1224 | 0 | 0 | 40 | not length($constraint_desc // '') and eval { do { require B } } |
1226 | 0 | 40 | 0 | $sub_name and $sub_name ne '__ANON__' |
1233 | 0 | 0 | 40 | not length($constraint_desc // '') and eval { do { require B::Deparse } } |
line | l | !l | condition |
---|---|---|---|
55 | 61 | 0 | (&CORE::GLOBAL::caller(0))[3] // '' |
70 | 61 | 0 | (&CORE::GLOBAL::caller(0))[3] // '' |
91 | 7 | 4 | $constraint //= sub { 1; } |
93 | 11 | 0 | (&CORE::GLOBAL::caller(0))[10] // {} |
163 | 25 | 73 | &reftype($previous_errors) // '' |
447 | 79 | 2 | &reftype($_[0]) // '' |
462 | 3 | 1 | &reftype($_[0]) // '' |
497 | 2 | 0 | &reftype($array_ref) // '' |
539 | 36 | 3 | &reftype($_[0]) // '' |
558 | 18 | 0 | &reftype($_[0]) // '' |
589 | 0 | 4 | $valtype // 'Any' |
603 | 4 | 0 | &reftype($hash_ref) // '' |
706 | 545 | 13 | $desc //= 'Value (%s)' |
727 | 757 | 0 | (&CORE::GLOBAL::caller(0))[10] // {} |
777 | 110 | 8 | (&CORE::GLOBAL::caller($uplevels))[10] // {} |
827 | 281 | 0 | (&CORE::GLOBAL::caller(0))[10] // {} |
933 | 27 | 15 | (&CORE::GLOBAL::caller(3))[3] // '' |
964 | 0 | 33 | $where //= sub { 1; } |
999 | 1 | 0 | (eval { do { if (@retvals == 1) { _up_validate(1, $type, $retvals[0], $where, 'Return value (' . _perl(@retvals) =~ s/^\(|\)$//gru . ") of call to $name()\n"); } else { undef; } } } // eval { do { _up_validate(1, $type, \@retvals, $listwhere, 'List of return values (' . _perl(@retvals) =~ s/^\(|\)$//gru . ") of call to $name()\n") } }) // die($@ =~ s/\s*+at \S+ line \d++.*+/sprintf "\nat %s line %d\n", (&CORE::GLOBAL::caller(1))[1, 2];/ersu) |
1025 | 23 | 7 | eval { do { _up_validate(1, $type, $retval, $where, 'Scalar return value (' . _perl($retval) . ") of call to $name()\n") } } // die($@ =~ s/\s*at \S+ line \d+.*/sprintf "\nat %s line %d\n", (&CORE::GLOBAL::caller(1))[1, 2];/eru) |
1130 | 28 | 18 | $named_B_for{$sig_b} //= {map({$_->{'named'} ? ($_->{'named'}, $_) : ();} @{$sig_b;})} |
1136 | 88 | 0 | $sig_a->[$n] // {} |
1138 | 88 | 0 | ($sig_a_name ? $named_B->{$sig_a_name} : $sig_b->[$n]) // {} |
1139 | 88 | 0 | $sig_a_n->{'type'} // 'Any' |
88 | 0 | $sig_b_n->{'type'} // 'Any' | |
1146 | 0 | 26 | $sig_a_n->{'where'} // 0 |
1147 | 0 | 26 | $sig_b_n->{'where'} // 0 |
1224 | 40 | 0 | $constraint_desc // '' |
1233 | 40 | 0 | $constraint_desc // '' |
line | l | !l&&r | !l&&!r | condition |
---|---|---|---|---|
35 | 2 | 2 | 0 | $export_as //= $exported |
434 | 17 | 0 | 13 | $user_defined_type[$idx]->($typename)->($_) || &_error_near($_[0], $typename) |
439 | 2 | 0 | 0 | &blessed($_[0]) && $_[0]->isa($typename) || &_error_near($_[0], $typename) |
497 | 1 | 0 | 1 | (&reftype($array_ref) // '') ne 'ARRAY' or not $final_handler and @{$array_ref;} != @types |
507 | 0 | 1 | 0 | $final_any or @{$array_ref;} == @types |
635 | 0 | 0 | 26 | not $reftype or $reftype ne 'REF' and $reftype ne 'SCALAR' |
657 | 0 | 0 | 0 | !&blessed($_[0]) || overload::Method($_[0], '""') |
669 | 26 | 0 | 0 | !&blessed($_[0]) || overload::Method($_[0], '""') |
678 | 0 | 8 | 0 | &blessed($_[0]) or $handler_for{'Class'}->($_[0]) |
692 | 0 | 10 | 0 | &blessed($_[0]) or $handler_for{'Class'}->($_[0]) |
838 | 167 | 0 | 114 | $value_desc or @constraints |
999 | 0 | 1 | 0 | eval { do { if (@retvals == 1) { _up_validate(1, $type, $retvals[0], $where, 'Return value (' . _perl(@retvals) =~ s/^\(|\)$//gru . ") of call to $name()\n"); } else { undef; } } } // eval { do { _up_validate(1, $type, \@retvals, $listwhere, 'List of return values (' . _perl(@retvals) =~ s/^\(|\)$//gru . ") of call to $name()\n") } } |
1106 | 12 | 20 | 0 | $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 |
1157 | 10 | 44 | 18 | $partial_ordering ||= $is_narrower |
1179 | 45 | 28 | 18 | $narrowness_for{join $;, $sig1, $sig2} //= _cmp_signatures($sig1, $sig2) |
1246 | 40 | 0 | 0 | $constraint_desc // "$constraint" |