Branch Coverage

blib/lib/YAML/PP/Representer.pm
Criterion Covered Total %
branch 77 96 80.2


line true false branch
23 1 183 if ($preserve == 1)
30 0 184 if (keys %args)
56 131 2158 if ($preserve_style or $preserve_alias)
57 87 44 if (ref $node->{'value'} eq "YAML::PP::Preserve::Scalar")
59 21 66 if ($preserve_style)
67 6 2283 if (not $node->{'reftype'} and &reftype(\$node->{'value'}) eq "GLOB")
71 415 1874 if ($node->{'reftype'}) { }
79 34 2255 if ($node->{'reftype'} eq "HASH" and my $tied = tied %{$$node{"data"};})
82 0 34 if (my $def = $representers->{'tied_equals'}{$tied})
88 205 2084 if ($node->{'reftype'} eq 'HASH') { }
128 1956 elsif ($node->{'reftype'} eq 'ARRAY') { }
1 1955 elsif ($node->{'reftype'}) { }
89 205 0 unless (defined $node->{'items'})
92 24 181 if ($self->preserve_order) { }
103 19 186 if ($self->preserve_flow_style and &reftype($node->{'value'}) eq "HASH")
104 18 1 if (my $tied = tied %{$$node{"value"};})
111 128 0 unless (defined $node->{'items'})
115 10 118 if ($self->preserve_flow_style and &reftype($node->{'value'}) eq "ARRAY")
116 10 0 if (my $tied = tied @{$$node{"value"};})
126 1892 63 unless (defined $node->{'items'})
147 60 1814 unless (defined $node->{'value'})
148 60 0 if (my $undef = $representers->{'undef'}) { }
149 60 0 if &$undef($self, $node)
157 0 1814 if ($] >= "5.036" and my $rep = $representers->{'bool'})
159 0 0 if (&$is_bool($node->{'value'}))
166 429 2445 if ($flags & $check_flags)
167 420 9 if $rep->{'code'}->($self, $node)
171 109 1285 if (my $rep = $representers->{'equals'}{$node->{'value'}})
172 109 0 if $rep->{'code'}->($self, $node)
175 98 983 if ($node->{'value'} =~ /$rep->{'regex'}/)
176 92 6 if $rep->{'code'}->($self, $node)
179 1193 0 unless (defined $node->{'data'})
182 1177 16 unless (defined $node->{'style'})
192 111 304 if (my $classname = &blessed($node->{'value'}))
193 65 46 if (my $def = $representers->{'class_equals'}{$classname})
195 65 0 if &$code($self, $node)
199 43 0 if (ref $re and $classname =~ /$re/ or $re)
200 42 1 if &$code($self, $node)
205 2 1 if ($node->{'value'}->isa($class_name))
206 2 0 if &$code($self, $node)
210 4 302 if ($node->{'reftype'} eq "SCALAR" and my $scalarref = $representers->{'scalarref'})
212 4 0 if &$code($self, $node)
214 4 298 if ($node->{'reftype'} eq "REF" and my $refref = $representers->{'refref'})
216 4 0 if &$code($self, $node)
218 5 293 if ($node->{'reftype'} eq "CODE" and my $coderef = $representers->{'coderef'})
220 5 0 if &$code($self, $node)
222 6 287 if ($node->{'reftype'} eq "GLOB" and my $glob = $representers->{'glob'})
224 6 0 if &$code($self, $node)