Branch Coverage

blib/lib/YAML/PP/Dumper.pm
Criterion Covered Total %
branch 57 64 89.0


line true false branch
26 174 10 unless defined $header
28 179 5 unless defined $footer
37 183 1 unless (&blessed($emitter))
43 0 184 if (keys %args)
102 18 1206 if ($self->version_directive)
126 569 1793 if (ref $value)
130 142 427 if ($seen->{$refaddr} and $seen->{$refaddr} > 1)
132 73 69 if (defined $anchor) { }
133 21 48 if ($self->representer->preserve_alias)
134 7 14 if (ref $node->{'value'} eq 'YAML::PP::Preserve::Scalar') { }
7 7 elsif (&reftype($node->{'value'}) eq 'HASH') { }
7 0 elsif (&reftype($node->{'value'}) eq 'ARRAY') { }
135 5 2 if (defined $node->{'value'}->alias)
141 7 0 if (my $tied = tied %{$$node{"value"};})
142 5 2 if (defined $tied->{'alias'})
149 7 0 if (my $tied = tied @{$$node{"value"};})
150 5 2 if (defined $tied->{'alias'})
157 54 15 unless (defined $node->{'anchor'})
178 73 2288 if ($type eq "alias")
182 205 2083 if ($type eq "mapping")
185 0 205 if ($node->{'items'} and @{$node->{'items'};} == 0)
199 128 1955 if ($type eq "sequence")
201 5 123 if (@{$node->{'items'};} == 0)
253 1396 501 unless my $reftype = &reftype($doc)
256 63 438 if ($reftype eq "SCALAR" and grep {ref $doc eq $_;} @{[] unless $self->representer->schema->bool_class;})
257 17 63 unless $self->representer->schema->bool_class
260 63 0 if (ref $doc eq "boolean" or ref $doc eq "JSON::PP::Boolean")
264 73 365 if (++$$seen{&refaddr($doc)} > 1)
268 0 365 unless ($_reftypes{$reftype})
272 203 162 if ($reftype eq 'HASH') { }
124 38 elsif ($reftype eq 'ARRAY') { }
8 30 elsif ($reftype eq 'REF') { }