Branch Coverage

blib/lib/Org/Document.pm
Criterion Covered Total %
branch 161 174 92.5


line true false branch
122 81 0 unless (@{$self->todo_states;} or @{$self->done_states;})
126 89 4 unless (@{$self->priorities;})
134 2 55 unless defined $args and length $args
138 0 165 if (defined $+{'squote'}) { }
0 165 elsif (defined $+{'dquote'}) { }
154 4 0 if (/\A(?:[A-Za-z0-9_:-]+|\|)\z/l) { }
0 0 elsif (/"/l) { }
167 96 0 unless $self->document
169 95 1 if (defined $args->{'from_string'})
201 0 4729 unless keys %m
207 4049 680 if (defined $m{'text'}) { }
211 270 410 if (@text)
213 85 185 if ($last_el and $last_el->isa("Org::Element::ListItem"))
225 17 68 if ($restlines)
229 11 6 if ($restlineslevel <= $listlevel)
234 2 0 if ($last_lists->[$i])
254 3 677 if ($m{'block'} and $pass == 2) { }
60 617 elsif ($m{'setting'}) { }
7 610 elsif ($m{'fixedw'} and $pass == 2) { }
18 592 elsif ($m{'comment'} and $pass == 2) { }
6 586 elsif ($m{'table'} and $pass == 2) { }
15 571 elsif ($m{'drawer'} and $pass == 2) { }
90 481 elsif ($m{'li_header'} and $pass == 2) { }
171 449 elsif ($m{'headline'} and $pass == 2) { }
270 6 54 if ($m{'setting_indent'} and not grep({$_ eq $uc_setting_name;} @{'Org::Element::Setting'->indentable_settings;})) { }
338 6 76 $bullet =~ /^\d+\./l ? :
8 82 defined $dt ? :
340 6 84 $type eq 'O' ? :
346 27 80 if ($last_lists->[$i])
353 6 39 if (not $list or $list->type ne $type or $list->bullet_style ne $bstyle)
360 11 40 unless $parent->children
371 6 84 if $cbstate
372 8 82 if defined $dt
386 171 10 if $parent = $last_headlines->[$i]
395 7 164 if $m{'h_tags'}
403 38 133 if ($title =~ s/^($todo_kw_re)(\s+|\W)/$2/l)
408 6 32 grep({$_ eq $state;} @{$self->done_states;}) ? :
414 4 167 if ($title =~ s/\[#($prio_re)\]\s*//l)
419 6 165 if ($title =~ s(\[(\d+%|\d+/\d+)\]\s*)[]lo)
433 0 670 unless $el or $pass != 2
435 155 515 unless $parent->children
441 79 105 if (@text)
459 172 11 if $container->children and @{$container->children;} == 1 and $container->children->[0]->isa("Org::Element::Text")
479 1012 964 if (defined $m{'plain_text'} and $pass == 2) { }
483 117 847 if (@plain_text)
489 6 958 if ($m{'link'} and $pass == 2) { }
4 954 elsif ($m{'radio_target'}) { }
0 954 elsif ($m{'target'} and $pass == 2) { }
1 953 elsif ($m{'fn_num'} and $pass == 2) { }
1 952 elsif ($m{'fn_namedef'} and $pass == 2) { }
3 949 elsif ($m{'fn_nameidef'} and $pass == 2) { }
3 946 elsif ($m{'trange'} and $pass == 2) { }
26 920 elsif ($m{'tstamp'} and $pass == 2) { }
5 915 elsif ($m{'act_trange'} and $pass == 2) { }
29 886 elsif ($m{'act_tstamp'} and $pass == 2) { }
24 862 elsif ($m{'markup_start'} and $pass == 2) { }
48 1594 elsif ($m{'markup_end'} and $pass == 2) { }
495 3 3 if (defined $m{'link_desc'} and length $m{'link_desc'})
524 1 0 $m{'fn_namedef_def'} ? :
538 2 1 length $m{'fn_nameidef_def'} ? :
596 0 961 unless $el or $pass != 2
597 40 921 unless $parent->children
602 394 194 if (@plain_text and $pass == 2)
603 268 126 unless $parent->children
610 413 175 if ($pass == 2)
612 1 412 if (@{$self->radio_targets;})
631 6 407 unless my $c = $parent->children
639 809 22 unless $c->[$i]{'_mu_start'}
644 407 22 unless ($mu_start_index >= 0)
656 59 1 if ($c->[$i]->isa('Org::Element::Text')) { }
662 13 47 if ($c->[$i]{'_mu_end'} and $c->[$i]->text eq $mu)
668 2 45 if $newlines > 1
677 13 9 if ($valid) { }
694 12 1 if (@c2 == 1)
710 310 110 unless @$els >= 2
714 110 352 if $i >= @$els
715 137 215 if $els->[$i]->children or not $els->[$i]->isa("Org::Element::Text")
718 91 104 if $i + 1 >= @$els or $$els[$i + 1]->children or not $$els[$i + 1]->isa("Org::Element::Text")
720 21 83 if ($$els[$i + 1]->style // "") ne $istyle
736 7 1 unless $c
739 7 5 if ($el->isa("Org::Element::Text"))
741 5 2 unless @split0 > 1
744 3 5 if ($s =~ /^$re$/l) { }
4 1 elsif (length $s) { }
768 30 87 unless $parent->children
791 2 9 unless $pos1 >= 0
793 2 7 unless $pos2 >= 0