Branch Coverage

blib/lib/XML/DT.pm
Criterion Covered Total %
branch 148 300 49.3


line true false branch
520 0 13 if ($xml{'-declr'})
521 0 0 if ($xml{'-outputenc'}) { }
529 0 13 if defined $xml{'-type'}
532 0 13 if $xml{'-begin'}
545 0 13 if $xml{'-xinclude'}
549 0 13 if ($xml{'-recover'}) { }
0 13 elsif ($xml{'-html'}) { }
555 0 0 unless $doc
563 0 0 unless $doc
574 1 12 if ($xml{'-end'}) { }
581 0 13 if ($declr) { }
603 27 11 if $pattern eq '^' and @XML::DT::dtcontext == 1 or $pattern eq '.*'
609 0 0 if (defined $b) { }
0 0 elsif (defined $a) { }
616 0 0 if (defined $b) { }
0 0 elsif (defined $a) { }
624 0 0 if (defined $b) { }
0 0 elsif (defined $a) { }
632 0 0 if (defined $b) { }
0 0 elsif (defined $a) { }
656 0 0 if ($contents->{'success'}) { }
673 1 19 if ($xml{'-declr'})
674 0 1 if ($xml{'-outputenc'}) { }
681 16 4 unless defined $xml{'-type'}
685 0 20 if ($xml{'-begin'})
689 3 17 if ($xml{'-inputenc'})
701 0 20 if ($xml{'-recover'}) { }
0 20 elsif ($xml{'-html'}) { }
707 0 0 unless $doc
716 0 0 unless defined $doc
727 0 20 if ($xml{'-end'}) { }
734 1 19 if ($declr) { }
757 4 0 defined $XML::DT::v{$1} ? :
758 2 3 keys %XML::DT::v ? :
759 0 9 if (/^not\((.*)\)$/) { }
4 5 elsif (/^('|")([^\1]*)(\1)\s*=\s*('|")([^\4]*)\4$/) { }
0 5 elsif (/^(.*?)normalize-space\((['"])([^\2)]*)\2\)(.*)$/) { }
0 5 elsif (/starts-with\((['"])([^\1))]*)\1,(['"])([^\3))]*)\3\)/) { }
0 5 elsif (/contains\((['"])([^\1))]*)\1,(['"])([^\3))]*)\3\)/) { }
0 5 elsif (/^(.*?)string-length\((['"])([^\2]*)\2\)(.*)$/) { }
0 5 elsif (/^(\d+)\s*=(\d+)$/) { }
0 5 elsif (/^(\d+)\s*<(\d+)$/) { }
0 5 elsif (/^(\d+)\s*>(\d+)$/) { }
5 0 elsif (/^(['"])([^\1]*)\1$/) { }
795 0 0 unless $string and $preffix
796 0 0 if $string =~ /^$preffix/
804 0 0 unless $string and $s
805 0 0 if $string =~ /$s/
828 1 15 if ($z =~ /\w+(\|\w+)+/) { }
10 5 elsif ($z =~ m((//|/|)(.*)/([^\[]*)(?:\[(.*)\])?)) { }
836 7 3 if ($first eq '/' and not $second) { }
855 9 26 unless $l->[0] or $l->[1]
856 3 0 if $l->[0] eq '/' and $l->[1]
857 9 29 if ($l->[3]) { }
858 4 5 if (inctxt("$prefix$l->[1]") and _testAttr($l->[3]))
861 20 9 if (inctxt("$prefix$l->[1]"))
864 0 14 if $aux2{$z}
865 4 10 if $h{'-default'}
883 9 233 exists $xml->{'-type'} && exists $xml->{'-type'}{'-default'} ? :
887 0 242 if (ref $type eq 'mmapon')
893 202 40 if ($type eq 'STR') { }
0 40 elsif ($type eq 'THE_CHILD' or $type eq 'LAST_CHILD') { }
5 35 elsif ($type eq 'SEQ' or $type eq 'ARRAY') { }
2 33 elsif ($type eq 'SEQH' or $type eq 'ARRAYOFHASH') { }
0 33 elsif ($type eq 'MAP' or $type eq 'HASH') { }
0 33 elsif ($type eq 'MULTIMAP') { }
0 33 elsif ($type eq 'MMAPON' or $type eq 'HASHOFARRAY') { }
33 0 elsif ($type eq 'NONE') { }
0 0 elsif ($type eq 'ZERO') { }
908 0 507 unless $tree
910 0 507 ref $tree eq 'XML::LibXML::CDATASection' ? :
912 0 507 if (ref $tree eq 'XML::LibXML::CDATASection') { }
0 507 elsif (ref $tree eq 'XML::LibXML::Comment') { }
298 209 elsif (ref $tree eq 'XML::LibXML::Text') { }
209 0 elsif (ref $tree eq 'XML::LibXML::Element') { }
0 0 elsif (ref $tree eq 'XML::LibXML::Node') { }
916 0 0 defined $xml->{'-outputenc'} ? :
918 0 0 if (defined $xml->{'-cdata'}) { }
0 0 elsif (defined $xml->{'-pcdata'}) { }
935 0 0 defined $xml->{'-outputenc'} ? :
936 0 0 if (defined $xml->{'-pcdata'})
947 3 295 defined $xml->{'-outputenc'} ? :
949 0 298 if (defined $xml->{'-pcdata'})
960 40 169 if (exists $xml->{'-ignorecase'})
978 0 0 if ($tree->nodeType == 5) { }
980 0 0 if ($tree->textContent) { }
992 446 15 if (defined $aux)
461 46 if ($type eq 'STR') { }
0 46 elsif ($type eq 'THE_CHILD' or $type eq 'LAST_CHILD') { }
9 37 elsif ($type eq 'SEQ' or $type eq 'ARRAY') { }
4 33 elsif ($type eq 'SEQH' or $type eq 'ARRAYHASH') { }
0 33 elsif ($type eq 'MMAPON') { }
0 33 elsif ($type eq 'MAP' or $type eq 'HASH') { }
0 33 elsif ($type eq 'MULTIMAP') { }
33 0 elsif ($type eq 'NONE') { }
994 0 0 unless _whitepc($aux, $name)
996 9 0 unless _whitepc($aux, $name)
998 4 0 unless _whitepc($aux, $name)
1004 0 0 unless (_whitepc($aux, $name))
1005 0 0 if (not $typeargs{$name}) { }
1006 0 0 if defined $r->{$name}
1008 0 0 unless _whitepc($aux, $name)
1011 0 0 unless (_whitepc($aux, $name))
1012 0 0 if defined $r->{$name}
1015 0 0 unless _whitepc($aux, $name)
1031 3 206 if (defined $xml->{'-outputenc'})
1037 53 156 if (defined $xml->{$XML::DT::q}) { }
149 7 elsif (defined $xml->{'-default'}) { }
0 7 elsif (defined $xml->{'-tohtml'}) { }
1054 0 44 if (not @_) { }
21 23 elsif (ref $_[0]) { }
1062 23 21 if (not ref $c) { }
16 5 elsif (ref $c eq 'HASH' and $c->{'-q'} and $c->{'-c'}) { }
0 5 elsif (ref $c eq 'HASH') { }
5 0 elsif (ref $c eq 'ARRAY') { }
1063 0 23 if ($q eq '-pcdata') { }
4 19 elsif ($q eq 'link' or $q eq 'br' or $q eq 'hr' or $q eq 'img') { }
1074 9 7 ref $c ? :
1083 0 0 ref $c->{$_} eq 'ARRAY' ? :
0 0 $_ ne '-pcdata' ? :
1088 0 5 if (defined $q and exists $ty{$q} and $ty{$q} eq 'SEQH') { }
0 5 elsif (defined $q) { }
1093 8 0 ref $_ ? :
1101 64 54 if (not @_) { }
27 27 elsif (ref $_[0]) { }
1109 91 27 if (not ref $c) { }
20 7 elsif (ref $c eq 'HASH' and $c->{'-q'} and $c->{'-c'}) { }
0 7 elsif (ref $c eq 'HASH') { }
7 0 elsif (ref $c eq 'ARRAY') { }
1110 3 88 if ($q eq '-pcdata') { }
3 85 elsif ($c eq '') { }
1123 10 10 ref $c ? :
1132 0 0 ref $c->{$_} eq 'ARRAY' ? :
0 0 $_ ne '-pcdata' ? :
1137 0 7 if (defined $q and exists $ty{$q} and $ty{$q} eq 'SEQH') { }
0 7 elsif (defined $q) { }
1142 12 0 ref $_ ? :
1183 2 1 if exists $file->{$_}{'attributes'}
1233 2 1 if $att{$name}
1246 0 0 if ($file eq '-html') { }
0 0 elsif ($file eq '-latin1') { }
1263 0 37 if (ref $_ eq 'XML::LibXML::Namespace') { }
1286 0 0 unless ctxt(1)
1290 0 0 if ($XML::DT::c =~ /[^ \t\n]/)
1294 0 0 if ($files[0] eq '-html') { }
0 0 elsif ($files[0] eq '-latin1') { }
1318 0 0 if ($ele->{$e}) { }
1320 0 0 @f >= 1 && $f[0] eq '#PCDATA' ? :
1331 10 3 if $_[1] eq '-pcdata'
1343 0 4 if ($@) { }