Branch Coverage

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


line true false branch
26 736 10 unless defined $header
28 741 5 unless defined $footer
37 745 1 unless (&blessed($emitter))
43 0 746 if (keys %args)
102 18 1524 if ($self->version_directive)
126 961 2919 if (ref $value)
130 147 814 if ($seen->{$refaddr} and $seen->{$refaddr} > 1)
132 76 71 if (defined $anchor) { }
133 21 50 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 56 15 unless (defined $node->{'anchor'})
178 76 3803 if ($type eq "alias")
182 455 3348 if ($type eq "mapping")
185 0 455 if ($node->{'items'} and @{$node->{'items'};} == 0)
199 266 3082 if ($type eq "sequence")
201 9 257 if (@{$node->{'items'};} == 0)
253 2068 893 unless my $reftype = &reftype($doc)
256 64 829 if ($reftype eq "SCALAR" and grep {ref $doc eq $_;} @{[] unless $self->representer->schema->bool_class;})
257 17 64 unless $self->representer->schema->bool_class
260 64 0 if (ref $doc eq "boolean" or ref $doc eq "JSON::PP::Boolean")
264 76 753 if (++$$seen{&refaddr($doc)} > 1)
268 0 753 unless ($_reftypes{$reftype})
272 453 300 if ($reftype eq 'HASH') { }
262 38 elsif ($reftype eq 'ARRAY') { }
8 30 elsif ($reftype eq 'REF') { }