Branch Coverage

lib/DMS/Parser/Emitter.pm
Criterion Covered Total %
branch 114 288 39.5


line true false branch
59 0 0 unless ($warned++)
69 0 0 unless ($warned++)
84 0 23 if (not $lite and _contains_unordered($doc->{'body'}))
88 0 21 if (not $lite and defined $doc->{'meta'} and _contains_unordered($doc->{'meta'}))
92 2 21 $lite ? :
103 21 2 unless ($self->{'lite'})
105 0 21 unless $doc->{'comments'}
110 10 11 if ($pos eq 'leading') { }
0 11 elsif ($pos eq 'inner') { }
10 1 elsif ($pos eq 'trailing') { }
120 0 21 unless $doc->{'original_forms'}
123 19 0 unless exists $self->{'forms_by_path'}{$pk}
139 54 368 ref $_ eq 'DMS::Parser::Index' ? :
156 21 2 unless ($self->{'lite'})
157 0 21 unless $doc->{'comments'}
159 0 21 if (defined $first and not ref $first and $first eq "__fm__")
165 2 21 if ($fm_present or $has_fm_comments)
168 2 0 if (defined $doc->{'meta'}) { }
178 23 0 if (_is_table($body)) { }
0 0 elsif (_is_list($body)) { }
185 0 0 if ($nc)
193 0 0 if ($nc)
203 0 106 unless defined $v
207 41 65 if (builtin::blessed($v))
215 0 73 unless defined $v
216 41 32 if builtin::blessed($v)
228 31 0 if ($tied and ref $tied eq "Tie::IxHash")
241 0 84 unless defined $v
242 41 43 if (builtin::blessed($v))
246 0 41 if ref $v eq "DMS::Parser::UnorderedTable"
251 26 17 if (ref $v eq "HASH")
253 0 51 if $k eq "\0_keys"
254 0 51 if _contains_unordered($v->{$k})
258 4 13 if (ref $v eq "ARRAY")
260 0 10 if _contains_unordered($item)
274 2 26 if ($self->{'lite'})
283 0 4 unless ($r)
284 0 0 $k =~ /\A[A-Za-z_][A-Za-z0-9_-]*\z/ ? :
286 0 0 if (not $v =~ /[\\"\x00-\x1F]/) { }
293 0 4 if ($r eq "DMS::Parser::Bool")
294 0 0 $k =~ /\A[A-Za-z_][A-Za-z0-9_-]*\z/ ? :
296 0 0 $$v ? :
300 4 0 if ($r eq "DMS::Parser::Integer")
301 4 0 $k =~ /\A[A-Za-z_][A-Za-z0-9_-]*\z/ ? :
312 0 0 if ($can_block) { }
314 0 0 if (_is_table($v)) { }
332 9 42 if ($nc)
346 7 44 if ($needs_block) { }
347 0 7 if ($has_inner)
354 3 4 if (_is_table($v)) { }
369 0 4 if ($self->{'lite'})
375 0 0 if (_is_table($v) and scalar _table_keys($v)) { }
0 0 elsif (_is_list($v) and scalar @$v) { }
394 0 10 if ($nc)
402 0 10 if (_is_table($v) and scalar _table_keys($v)) { }
0 10 elsif (_is_list($v) and scalar @$v) { }
403 0 0 if ($has_inner)
412 0 0 if ($has_inner)
433 41 13 if (builtin::blessed($v))
435 0 0 $v->value ? :
0 41 if ($cls eq 'DMS::Parser::Bool') { }
41 0 elsif ($cls eq 'DMS::Parser::Integer') { }
0 0 elsif ($cls eq 'DMS::Parser::Float') { }
0 0 elsif ($cls eq 'DMS::Parser::OffsetDateTime' or $cls eq 'DMS::Parser::LocalDateTime' or $cls eq 'DMS::Parser::LocalDate' or $cls eq 'DMS::Parser::LocalTime') { }
445 0 13 if (_is_list($v))
446 0 0 unless (@$v)
450 0 0 if $i > 0
451 0 0 $lite ? :
457 0 13 if (_is_table($v))
459 0 0 unless (@keys)
464 0 0 unless $first
468 0 0 $lite ? :
475 0 13 unless (defined $v)
481 0 41 if ($self->{'lite'})
488 11 0 if ($lit_ref and exists $lit_ref->{'integer_lit'})
498 0 0 if (isnan($f))
499 0 0 $f > 0 ? :
0 0 if (isinf($f))
503 0 0 if (0 + $s == $f)
507 0 0 unless ($s =~ /[.eE]/)
517 0 13 if ($self->{'lite'})
525 8 0 if ($lit_ref and exists $lit_ref->{'string_form'})
528 5 8 if (not $form or $form->{'kind'} eq "basic")
534 1 7 if ($form->{'kind'} eq "literal")
540 7 0 if ($form->{'kind'} eq "heredoc")
547 0 7 unless $form->{'modifiers'}
548 0 1 if ($m->{'name'} eq "_fold_paragraphs")
550 0 7 if ($has_fold)
564 3 4 $last_nl < 0 ? :
572 5 2 $flavor eq 'basic_triple' ? :
574 5 2 if defined $label
580 0 1 unless $m->{'args'}
581 1 1 unless $first
588 0 7 if (length $body == 0) { }
592 0 7 if (length $line == 0) { }
602 5 2 if (defined $label) { }
605 1 1 $flavor eq 'basic_triple' ? :
611 0 2 if (builtin::blessed($v))
613 0 0 $v->value ? :
0 0 if ($cls eq 'DMS::Parser::Bool') { }
0 0 elsif ($cls eq 'DMS::Parser::Integer') { }
0 0 elsif ($cls eq 'DMS::Parser::Float') { }
0 0 elsif ($cls eq 'DMS::Parser::OffsetDateTime' or $cls eq 'DMS::Parser::LocalDateTime' or $cls eq 'DMS::Parser::LocalDate' or $cls eq 'DMS::Parser::LocalTime') { }
623 0 2 if (_is_list($v))
624 0 2 if (_is_table($v))
635 9 0 if (index($text, "\n") == -1)
645 0 0 if ($i == 0) { }
658 0 54 if $self->{'lite'}
660 46 8 unless $nc and @{$nc->{'trailing'};}
663 8 0 $first ? :
671 0 54 if $self->{'lite'}
673 46 8 unless $nc
682 0 61 if $self->{'lite'}
689 0 30 if $self->{'lite'}
691 29 1 unless $nc
706 0 0 unless ($self->{'lite'})
707 0 0 unless $self->{'doc'}{'comments'}
708 0 0 if scalar @{$ac->{'path'};} <= scalar @$path
710 0 0 $pk_prefix eq '' ? :
711 0 0 if ($pk_prefix eq '') { }
0 0 elsif (substr($apk, 0, length $prefix) eq $prefix) { }
719 0 0 unless (ref $v or builtin::blessed($v))
722 0 0 if ($lit and exists $lit->{'string_form'} and $lit->{'string_form'}{'kind'} eq "heredoc")
727 0 0 if (builtin::blessed($v))
728 0 0 if (_is_list($v))
731 0 0 unless $self->_is_flow_safe($v->[$i], $sub)
735 0 0 if (_is_table($v))
738 0 0 unless $self->_is_flow_safe($v->{$k}, $sub)
749 6 1 unless $s =~ /[\\"\x00-\x1F]/
753 0 1 if ($ch eq '\\') { }
0 1 elsif ($ch eq '"') { }
1 0 elsif ($ch eq "\n") { }
0 0 elsif ($ch eq "\r") { }
0 0 elsif ($ch eq "\t") { }
0 0 elsif ($ch eq "\cH") { }
0 0 elsif ($ch eq "\f") { }
0 0 elsif ($code < 32) { }
768 0 0 if $c eq "_" or $c eq "-"
770 0 0 if ($o < 128)
785 51 0 if $k =~ /\A[A-Za-z_][A-Za-z0-9_-]*\z/
786 0 0 if (length $k > 0)
789 0 0 unless (_is_bare_key_char_emit($ch))
791 0 0 if $bare
794 0 0 if (index($k, "'") == -1 and index($k, "\n") == -1 and index($k, "\r") == -1)