Branch Coverage

blib/lib/Data/Match.pm
Criterion Covered Total %
branch 146 266 54.8


line true false branch
331 21 0 if ($autoload_pat{$pat} eq 1) { }
335 0 21 if $@
364 2 116 @opts & 1 ? :
390 0 0 ref $self ? :
411 21 95 if (not $$self{'disable_patterns'} and UNIVERSAL::isa($$p[$$p_i], 'Data::Match::Pattern::REST')) { }
425 22 94 unless $match
478 11 18 if (not $$self{'disable_patterns'} and $k =~ /^Data::Match::Pattern::ANY=/ || UNIVERSAL::isa($k, 'Data::Match::Pattern::ANY')) { }
3 15 elsif (not $$self{'disable_patterns'} || $rest_pat and UNIVERSAL::isa($$p{$k}, 'Data::Match::Pattern::REST')) { }
483 11 0 unless ($any_key++)
490 3 8 if $self->_match($$x{$xk}, $$p{$k})
520 15 14 unless $match
524 3 9 if ($rest_pat) { }
531 6 3 unless $any_key
581 0 673 unless $$self{'depth'} > 0
582 0 673 unless (@{$$self{'path'};} & 1) == 0
606 80 1523 if ($x eq $p) { }
1338 185 elsif (not $$self{'disable_patterns'} and UNIVERSAL::isa($p, 'Data::Match::Pattern')) { }
83 102 elsif (ref $x) { }
619 2 81 if ($$self{'visiting'}{$x}++) { }
0 81 elsif (my $visit = $$self{'match'}{ref $x}) { }
42 39 elsif (UNIVERSAL::isa($x, 'ARRAY') and UNIVERSAL::isa($p, 'ARRAY')) { }
27 12 elsif (UNIVERSAL::isa($x, 'HASH') and UNIVERSAL::isa($p, 'HASH')) { }
0 12 elsif (UNIVERSAL::isa($x, 'SCALAR') and UNIVERSAL::isa($p, 'SCALAR')) { }
644 0 12 if (my $comparator = $$self{'compare'}{ref $x or '*'}) { }
691 0 118 if $opts
715 118 0 unless $$self{'keep_visiting'}
721 0 118 unless $$self{'depth'} == 0
722 0 118 if @{$$self{'path'};}
723 0 118 unless $$self{'root'} eq $x
724 0 118 unless $$self{'pattern'} eq $p
749 118 0 if (wantarray) { }
752 0 0 $matches ? :
787 11 0 $match ? :
804 36 0 unless $c
807 0 0 $$c{$k}{'v'} ? :
808 0 0 $$c{$k}{'p'} ? :
809 0 0 $$c{$k}{'ps'} ? :
810 0 0 $$c{$k}{'pdr'} ? :
828 22 0 unless $c
831 0 0 unless ($$s{$k})
835 0 0 $$s{$k}{'v'} ? :
836 0 0 $$s{$k}{'p'} ? :
837 0 0 $$s{$k}{'ps'} ? :
838 0 0 $$s{$k}{'pdr'} ? :
882 95 55 unless defined $str
891 186 81 if ($ref eq 'ARRAY') { }
16 65 elsif ($ref eq 'HASH') { }
0 65 elsif ($ref eq 'SCALAR') { }
65 0 elsif ($ref eq 'METHOD') { }
892 2 184 if (ref $ind eq 'ARRAY') { }
900 16 0 if (ref $ind eq 'ARRAY') { }
914 0 65 if (ref $ind eq 'ARRAY') { }
948 0 0 unless defined $str
949 0 0 unless defined $sep
957 0 0 if ($ref eq 'ARRAY') { }
0 0 elsif ($ref eq 'HASH') { }
0 0 elsif ($ref eq 'SCALAR') { }
0 0 elsif ($ref eq 'METHOD') { }
958 0 0 if (ref $ind eq 'ARRAY') { }
966 0 0 if (ref $ind eq 'ARRAY') { }
1018 0 55 if $@
1020 55 0 unless defined $root
1052 0 0 if $@
1054 0 0 unless defined $root
1086 0 0 if $@
1088 0 0 unless defined $root
1117 0 261 unless @$self >= $self->subpattern_offset
1131 1077 258 unless $matchobj->_match($x, $$self[$i])
1143 9 35 if $matchobj->_match($x, $$self[$i])
1173 6 1 scalar @$self ? :
1191 24 18 if (@{$self;}) { }
1221 56 63 unless $$matchobj{'no_collect_path'}
1224 40 79 if $$matchobj{'collect_path_str'}
1227 0 119 if $$matchobj{'collect_path_DRef'}
1241 463 98 unless $self->match_and($x, $matchobj)
1274 1 24 unless $self->match_and($x, $matchobj)
1278 7 17 if ($binding) { }
1280 4 3 if (Compare($$binding{'v'}[0], $x)) { }
1309 1 2 if $x =~ /$$self[0]/sx
1326 167 232 if UNIVERSAL::isa($x, $$self[0])
1344 0 0 if $x
1382 10 2 if (ref $x) { }
1383 8 2 if (UNIVERSAL::isa($x, 'ARRAY')) { }
2 0 elsif (UNIVERSAL::isa($x, 'HASH')) { }
0 0 elsif (UNIVERSAL::isa($x, 'SCALAR')) { }
1390 0 0 $x ? :
1399 3 9 @$self ? :
1424 20 9 if (UNIVERSAL::isa($$self[0], 'CODE')) { }
1429 0 9 if $@
1442 74 150 if $$self[1]($x, $matchobj, $self)
1523 0 11 unless defined $$self[0]
1554 2 7 if ($match_sub) { }
1570 5 4 if ($match_rest) { }
1578 2 7 if ($match_sub and $match_rest) { }
1581 1 1 if defined $$self[1] and $count >= $$self[1]
1588 6 2 if ($$self[0] <= $count) { }
1662 17 24 if $self->match_and($e, $matchobj)
1688 5 11 if $self->match_and($slice, $matchobj)
1701 0 0 if $self->match_and($$x, $matchobj)
1712 17 0 if (ref $x)
1713 0 17 if (my $eacher = $$matchobj{'each'}{ref $x}) { }
12 5 elsif (UNIVERSAL::isa($x, 'ARRAY')) { }
5 0 elsif (UNIVERSAL::isa($x, 'HASH')) { }
0 0 elsif (UNIVERSAL::isa($x, 'SCALAR')) { }
1714 0 0 if $self->_match_and($_[0], $matchobj)
1728 0 0 if $self->match_and($x, $matchobj)
1762 3 0 if (UNIVERSAL::isa($x, 'ARRAY')) { }
0 0 elsif (UNIVERSAL::isa($x, 'HASH')) { }
1821 74 436 if $self->match_and($x, $matchobj)
1824 272 238 if (ref $x)
1826 5 267 if $$visited{$x}++
1830 160 107 if (my $visit = $$matchobj{'find'}{ref $x} || $$matchobj{'visit'}{ref $x}) { }
104 3 elsif (UNIVERSAL::isa($x, 'ARRAY')) { }
3 0 elsif (UNIVERSAL::isa($x, 'HASH')) { }
0 0 elsif (UNIVERSAL::isa($x, 'SCALAR')) { }
1833 220 0 if @_
1835 220 0 if @_
1894 0 15 unless UNIVERSAL::isa($src, 'ARRAY')
1895 0 15 unless defined $from
1896 0 15 unless defined $to
1897 0 15 unless $from <= $to
1905 0 9 if $i < 0
1906 8 1 0 <= $i && $i < FETCHSIZE($_[0]) ? :
1913 0 1 if $_[1] >= $_[0][1]
1924 0 0 if ($_[1] > FETCHSIZE($_[0])) { }
1934 0 0 $_[0][2] > $_[0][1] ? :
1947 0 0 $_[0][1] < $_[0][2] ? :
1969 0 0 if 0 <= $_[1] and $_[1] < FETCHSIZE($_[0])
1979 0 0 if 0 <= $_[1] and $_[1] < FETCHSIZE($_[0])
2003 0 28 unless UNIVERSAL::isa($src, 'HASH')
2004 0 28 unless UNIVERSAL::isa($keys, 'ARRAY')
2012 48 2 $_[0][1]{$_[1]} ? :
2023 0 0 if (exists $_[0][1]{$_[1]})