Branch Coverage

blib/lib/Treex/PML/Schema/XMLNode.pm
Criterion Covered Total %
branch 37 62 59.6


line true false branch
19 63 19 if (ref $t->{'-schema'}) { }
24 82 0 if (exists $self->{'-##'})
32 325 45 if ref $val->{'-parent'} and not &isweak($val->{'-parent'})
33 282 88 if ref $val->{'-schema'} and not &isweak($val->{'-schema'})
48 11 355 if $attr =~ /^xmlns/
50 121 234 if (not defined $value and $attr eq 'name')
53 355 0 if (defined $value)
65 0 264 unless $self->{'-attributes'}
72 133 0 UNIVERSAL::DOES::does($val, 'Treex::PML::Schema::XMLNode') || !ref($val) ? :
8 133 ref $val eq 'ARRAY' ? :
51 141 ref $val eq 'HASH' ? :
87 269 48 if (UNIVERSAL::DOES::does($value, 'Treex::PML::Schema::XMLNode')) { }
91 48 0 if defined $key
93 48 0 if defined $key
101 10 270 if ($xml_name =~ /^#/) { }
270 0 elsif ($xml_name =~ /^{(.*)}(.*)$/ or $xml_name =~ /^()([^#].*)$/) { }
102 0 10 if ($xml_name =~ /^#text/) { }
10 0 elsif ($xml_name =~ /^#comment/) { }
0 0 elsif ($xml_name =~ /^#processing-instruction/) { }
0 0 elsif ($xml_name =~ /^#other/) { }
120 0 270 if ($ns ne $opts->{'DefaultNs'})
126 170 100 if (@children) { }
142 11 0 if (not defined $opts->{'fh'} || defined $opts->{'string'} and defined $filename)
145 11 0 unless ($opts->{'no_backups'})
146 0 11 unless eval { do { Treex::PML::IO::rename_uri($filename, $filename . '~'); $have_backup = 1 } }
156 0 11 $opts->{'no_indent'} ? :
0 11 $opts->{'no_indent'} ? :
167 0 11 if ($@)
169 0 0 if $have_backup
170 0 0 if $@
173 11 0 if $fh