Branch Coverage

blib/lib/YAML/PP/Constructor.pm
Criterion Covered Total %
branch 75 84 89.2


line true false branch
15 0 43 $ENV{'YAML_PP_LOAD_DEBUG'} || $ENV{'YAML_PP_LOAD_TRACE'} ? :
16 0 43 $ENV{'YAML_PP_LOAD_TRACE'} ? :
27 444 313 unless (defined $duplicate_keys)
33 1 756 if ($preserve == 1)
38 1 756 unless $cyclic_refs{$cyclic_refs}
41 0 756 if (keys %args)
105 34 2286 if ($event->{'version_directive'})
108 22 12 if ($self->{'schemas'}{$version}) { }
125 0 2288 unless $last->{'type'} eq "document"
126 0 2288 if (@$stack)
130 3 2285 if ($event->{'implicit'} and $self->require_footer)
142 4 2551 if ($c > ($self->max_depth || 512.0))
163 24 1299 if ($preserve_order || $preserve_style || $preserve_alias and not tied %$data)
166 15 1308 if ($preserve_style)
172 77 1246 if (defined(my $anchor = $event->{'anchor'}))
173 6 71 if ($preserve_alias)
175 5 1 unless (exists $self->anchors->{$anchor})
190 0 1301 unless $last->{'type'} eq "mapping"
196 6 2518 if (ref $key eq 'YAML::PP::Type::MergeKey') { }
198 1 5 if ((builtin::reftype($merge) || '') eq 'HASH') { }
4 1 elsif ((builtin::reftype($merge) || '') eq 'ARRAY') { }
203 5 2 if ((builtin::reftype($item) || '') eq 'HASH') { }
221 8 1 unless (exists $$data->{$key})
243 73 1213 if (defined(my $anchor = $last->{'event'}{'anchor'}))
264 9 1219 if ($preserve_style or $preserve_alias and not tied @$data)
271 30 1198 if (defined(my $anchor = $event->{'anchor'}))
272 6 24 if ($preserve_alias)
274 5 1 unless (exists $self->anchors->{$anchor})
287 0 1210 unless $last->{'type'} eq "sequence"
296 30 1180 if (defined(my $anchor = $last->{'event'}{'anchor'}))
314 83 7569 if ($preserve_style || $preserve_alias and not ref $value)
319 17 66 if ($preserve_style)
322 6 77 if ($preserve_alias and defined $event->{'anchor'})
324 5 1 unless (exists $self->anchors->{$anchor})
331 185 7467 if (defined(my $name = $event->{'anchor'}))
341 144 1 if (my $anchor = $self->anchors->{$name}) { }
344 9 135 unless ($anchor->{'finished'})
346 4 5 if ($cyclic_refs ne "allow")
347 2 2 if ($cyclic_refs eq "fatal")
350 1 1 if ($cyclic_refs eq 'warn') { }
1 0 elsif ($cyclic_refs eq 'ignore') { }
370 50 0 if ref $data eq "YAML::PP::Preserve::Scalar" and $self->preserve_scalar_style || $self->preserve_alias