Branch Coverage

blib/lib/Data/TOON/Encoder.pm
Criterion Covered Total %
branch 68 94 72.3


line true false branch
32 0 48 unless defined $value
36 27 21 if ($ref eq 'HASH') { }
2 19 elsif ($ref eq 'ARRAY') { }
39 0 27 if ($self->{'seen'}{$ref_addr})
45 0 27 if ($self->{'depth'} > $self->{'max_depth'})
53 0 2 if ($self->{'seen'}{$ref_addr})
59 0 2 if ($self->{'depth'} > $self->{'max_depth'})
73 2 51 if ($self->{'depth'} >= $self->{'max_depth'})
84 16 59 if ($ref eq 'ARRAY') { }
26 33 elsif ($ref eq 'HASH') { }
102 0 16 unless ref $array eq "ARRAY"
110 1 25 if (ref $item ne "HASH")
116 15 1 if ($all_objects and $array_len > 0) { }
128 1 24 if (@obj_keys != @first_keys)
134 0 60 if ($first_keys[$i] ne $obj_keys[$i])
140 0 24 unless ($can_tabular)
146 4 54 if (ref $val)
152 4 20 unless ($can_tabular)
157 10 5 if ($can_tabular) { }
163 1 9 if ($self->{'delimiter'} eq "\t") { }
3 6 elsif ($self->{'delimiter'} eq '|') { }
192 6 0 if (@keys > 0) { }
221 2 0 if defined $encoded
234 0 6 if (ref $item)
242 2 0 if ($all_primitives) { }
246 0 2 if ($self->{'delimiter'} eq "\t") { }
0 2 elsif ($self->{'delimiter'} eq '|') { }
259 0 0 if defined $encoded
269 0 107 unless defined $value
272 53 54 if ($value =~ /^[+-]?\d+(?:\.\d+)?$/u and not $value =~ /^(true|false|null)$/iu)
279 10 44 if ($self->_needs_quoting($value))
290 1 52 if ($num == 0)
298 3 49 if ($n =~ /\./u)
309 0 54 if $value eq ""
310 0 54 if $value =~ /^\s/u
311 0 54 if $value =~ /\s$/u
312 0 54 if $value eq "true" or $value eq "false" or $value eq "null"
313 0 54 if $value =~ /^-?\d+(?:\.\d+)?(?:e[+-]?\d+)?$/iu
314 0 54 if $value =~ /^0\d+$/u
315 0 54 if $value =~ /[:"\\\[\]{}-]/u
316 0 54 if $value =~ /[\r\n\t]/u
317 10 44 if $value =~ /$self->{'delimiter'}/u
318 0 44 if $value =~ /^-/u
339 54 13 unless @{$self->{'column_priority'};}
349 11 5 exists $priority{$a} ? :
350 9 7 exists $priority{$b} ? :
352 13 3 if ($a_priority != $b_priority)