Branch Coverage

blib/lib/XML/Writer.pm
Criterion Covered Total %
branch 190 190 100.0


line true false branch
42 146 157 if ($params{'NAMESPACES'})
60 1 156 if ($newlines)
66 10 147 if (lc $outputEncoding eq 'us-ascii') { }
109 1 86 if $use_selfcontained_output and defined wantarray
114 1 79 if (not $seen{'ELEMENT'}) { }
1 78 elsif ($elementLevel > 0) { }
128 1 21 if ($standalone and $standalone ne 'no')
135 18 4 unless (defined $encoding)
139 7 14 if ($encoding)
142 2 19 if ($standalone)
150 2 21 if ($seen{'ANYTHING'}) { }
161 3 5 if ($data) { }
166 7 1 if ($elementLevel == 0)
175 1 10 if ($name =~ /^xml/i and not $name =~ /^xml-(stylesheet|model)$/i)
179 2 9 if ($name =~ /\?\>/ or defined $data and $data =~ /\?\>/) { }
1 8 elsif ($name =~ /\s/) { }
190 5 9 if ($dataMode and $elementLevel)
195 5 9 if ($dataMode and $elementLevel) { }
8 1 elsif ($elementLevel == 0) { }
205 2 12 if ($data =~ /--/)
209 1 13 if ($data =~ /-->/) { }
221 5 5 if ($publicId) { }
2 3 elsif (defined $systemId) { }
222 2 3 unless (defined $systemId)
235 1 10 if ($seen{'DOCTYPE'}) { }
1 9 elsif ($seen{'ELEMENT'}) { }
248 29 14 if ($dataMode and $hasHeading || $elementLevel)
257 43 61 if ($dataMode)
272 1 102 if ($seen{'ELEMENT'} and $elementLevel == 0) { }
1 101 elsif ($elementLevel == 0 and $seen{'DOCTYPE'} and $name ne $seen{'DOCTYPE'}) { }
2 99 elsif ($dataMode and $hasData) { }
289 18 1 if ($dataMode and $hasHeading || $elementLevel)
296 19 59 if ($dataMode)
307 1 77 if ($seen{'ELEMENT'} and $elementLevel == 0) { }
1 76 elsif ($elementLevel == 0 and $seen{'DOCTYPE'} and $name ne $seen{'DOCTYPE'}) { }
1 75 elsif ($dataMode and $hasData) { }
325 1 79 unless $name
327 20 60 if ($dataMode and $hasElement)
332 36 44 if ($dataMode)
341 1 75 if ($elementLevel <= 0) { }
1 74 elsif ($name and $name ne $oldName) { }
352 1 39 if ($data =~ /[\&\<\>]/)
363 1 41 if ($elementLevel < 1) { }
1 40 elsif ($dataMode and $hasElement) { }
392 1 10 if ($elementLevel < 1) { }
1 9 elsif ($dataMode and $hasElement) { }
405 9 148 if ($unsafe) { }
443 2 2 if $el eq $ancestor
454 3 2 if ($n < scalar @elementStack) { }
463 4 3 if (ref $output ne 'XML::Writer::_PrintChecker') { }
473 2 160 if (defined $newOutput and not ref $newOutput and 'self' eq $newOutput)
478 7 156 if (ref $newOutput eq 'SCALAR') { }
484 14 1 if ($outputEncoding and ref $output eq 'GLOB' || $output->isa('IO::Handle'))
485 2 12 if (lc $outputEncoding eq 'utf-8') { }
10 2 elsif (lc $outputEncoding eq 'us-ascii') { }
495 6 155 if ($params{'CHECK_PRINT'})
503 2 3 $use_selfcontained_output ? :
507 1 1 unless $use_selfcontained_output
522 155 10 if ($_[0] =~ /^\s*$/) { }
530 7 1 if ($dataIndent =~ /^ *$/) { }
782 2 67 if ($anames{$name}) { }
797 2 69 if ($data =~ /[\&\<\>\"]/)
811 3 12 if ($_[0] =~ /[^\x00-\x7F]/)
819 4 112 if ($_[0] =~ /([\x00-\x08\x0B-\x0C\x0E-\x1F])/)
826 3 2 unless $$self{'OVERLOADSTRING'}()
851 8 138 if ($params{'PREFIX_MAP'})
865 4 142 if $defaultPrefix
884 2 142 if ($params{'FORCED_NS_DECLS'})
935 17 54 if (not $attFlag and $defaultPrefix and $uri eq $defaultPrefix) { }
20 34 elsif ($prefix) { }
936 12 5 unless ($nsDefaultDecl and $nsDefaultDecl eq $uri)
943 9 8 if (defined $$uriMap{''})
948 16 1 unless ($nsCopyFlag)
960 30 4 unless ($nsCopyFlag)
978 54 127 if (ref $_[0][0] eq 'ARRAY')
985 14 56 if (ref $_[0][$i] eq 'ARRAY')
995 3 178 if (@forcedNSDecls)
999 1 2 if ($defaultPrefix and $_ eq $defaultPrefix) { }
1021 94 6 unless ($unsafe)
1034 83 3 unless ($unsafe)
1049 22 51 if (ref $_[0] eq 'ARRAY') { }
1051 17 5 if ($pfx) { }
1068 135 9 unless ($unsafe)
1072 1 11 if (index($target, ':') >= 0)
1085 7 11 if ($prefix) { }
1088 4 7 if (defined $defaultPrefix)
1101 1 2 if ($defaultPrefix and $defaultPrefix eq $uri)
1142 55 122 if (ref $name eq 'ARRAY') { }
1 121 elsif (index($name, ':') >= 0) { }
1143 1 54 if (index($$name[1], ':') >= 0)
1155 13 12 if (ref $name eq 'ARRAY') { }
1157 1 12 if (index($local, ':') >= 0)
1161 1 11 if ($name =~ /^xmlns/) { }
1 10 elsif (index($name, ':') >= 0) { }
1212 2 2 if ($$self{'HANDLE'}->print(shift())) { }