Branch Coverage

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


line true false branch
15 0 48 $ENV{'YAML_PP_LOAD_DEBUG'} || $ENV{'YAML_PP_LOAD_TRACE'} ? :
16 0 48 $ENV{'YAML_PP_LOAD_TRACE'} ? :
27 453 313 unless (defined $duplicate_keys)
33 1 765 if ($preserve == 1)
38 1 765 unless $cyclic_refs{$cyclic_refs}
41 0 765 if (keys %args)
105 34 2295 if ($event->{'version_directive'})
108 22 12 if ($self->{'schemas'}{$version}) { }
125 0 2297 unless $last->{'type'} eq "document"
126 0 2297 if (@$stack)
130 3 2294 if ($event->{'implicit'} and $self->require_footer)
142 4 2857 if ($c > ($self->max_depth || 512.0))
163 24 1605 if ($preserve_order || $preserve_style || $preserve_alias and not tied %$data)
166 15 1614 if ($preserve_style)
172 77 1552 if (defined(my $anchor = $event->{'anchor'}))
173 6 71 if ($preserve_alias)
175 5 1 unless (exists $self->anchors->{$anchor})
190 0 1607 unless $last->{'type'} eq "mapping"
196 6 12130 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 1519 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 26496 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 26394 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