Branch Coverage

blib/lib/Text/Fragment.pm
Criterion Covered Total %
branch 85 98 86.7


line true false branch
35 0 6 if ($c eq '\\' or $c eq '"') { }
0 6 elsif (not $c =~ /[\x20-\x7F]/) { }
53 0 2 if ($c eq '\\') { }
64 3 5 $val =~ /\s|"|[^\x20-\x7f]/ ? :
78 27 6 if (length $id) { }
86 22 11 if ($comment_style eq 'shell') { }
3 8 elsif ($comment_style eq 'c') { }
3 5 elsif ($comment_style eq 'cpp') { }
2 3 elsif ($comment_style eq 'html') { }
3 0 elsif ($comment_style eq 'ini') { }
127 1 27 $2 ? :
141 10 2 if (ref $f{'attrs'}) { }
159 2 10 if ($f{'is_multi'} or $pl =~ /\R/) { }
160 1 1 unless $pl =~ /\R\z/
161 0 2 $te ? :
0 2 $te ? :
165 2 8 $te ? :
174 0 35 unless $which =~ /\A(?:list|get|insert|delete|set_attrs)\z/
177 0 35 if (ref $args{'label'} eq 'CODE') { }
186 0 35 unless defined $text
188 29 6 if ($which =~ /\A(?:get|insert|set_attrs|delete)\z/)
189 0 29 unless defined $id
191 29 6 if (defined $id)
192 1 28 unless $id =~ /$re_id/
197 1 11 unless /\A\w+\z/
199 2 9 unless (defined $attrs->{$_})
200 2 0 if ($which eq 'set_attrs') { }
212 0 33 unless $comment_style =~ /\A(cpp|c|shell|html|ini)\z/
222 12 21 if ($which eq 'insert')
223 0 12 unless defined $payload
226 6 27 if ($which eq 'list') { }
3 24 elsif ($which eq 'get') { }
3 21 elsif ($which eq 'set_attrs') { }
9 12 elsif ($which eq 'delete') { }
241 2 1 if ($text =~ /($one_line_pattern|$multi_line_pattern)/x) { }
261 4 2 if (defined $v) { }
270 2 1 if ($text =~ s/$one_line_pattern | $multi_line_pattern/&$sub(%+);/egx) { }
281 4 4 $f{'enl'} ? :
283 7 2 if ($text =~ s/(?\R?) (?$one_line_pattern | $multi_line_pattern)/&$sub(%+);/egx) { }
298 1 2 if $payload eq $f{'payload'}
305 1 11 if ($good_pattern and $text =~ /$good_pattern/)
309 3 8 if ($text =~ s/(?(?:$one_line_pattern | $multi_line_pattern))/&$sub(%+);/ex)
310 2 1 if ($replaced) { }
321 1 7 if ($replace_pattern and $text =~ /($replace_pattern)/)
328 1 6 if ($top_style) { }
5 1 elsif (length $text) { }
332 2 3 unless $enl
333 3 2 $enl ? :
338 1 6 $top_style ? :