Branch Coverage

blib/lib/Tag/Reader/Perl.pm
Criterion Covered Total %
branch 75 90 83.3


line true false branch
56 32 138 if (exists $self->{'text'}) { }
138 0 elsif (exists $self->{'filename'}) { }
76 0 170 if ($data eq $EMPTY_STR)
80 170 0 wantarray ? :
86 0 52 unless ($file and -r $file)
89 0 52 if (not $force and defined $self->{'text'} || defined $self->{'filename'})
95 0 52 unless (open $inf, '<', $file)
109 0 3 unless ($text)
112 0 0 if (not $force and defined $self->{'text'} || defined $self->{'filename'})
147 1092 3377 if ($self->{'spec_stay'} == 0) { }
150 166 926 if ($self->{'stay'} == 0 and $self->{'char'} eq '<') { }
190 736 elsif ($self->{'stay'} == 0) { }
736 0 elsif ($self->{'stay'} == 1) { }
153 111 55 if ($#{$$self{'data'};} == -1) { }
168 59 131 if ($self->{'tagcharpos'} == 0)
177 47 689 if ($self->{'char'} eq '>') { }
111 578 elsif ($self->{'tag_length'} == 1 and _is_first_char_of_tag($self->{'char'})) { }
247 331 elsif ($self->{'tag_length'} > 1 and _is_in_tag_name($self->{'char'})) { }
187 64 47 if ($self->{'char'} eq '!')
202 0 331 if ($self->{'tag_length'} == 1 or $self->{'char'} eq '<')
216 90 3287 if ($self->{'char'} eq '>') { }
56 3231 elsif ($self->{'spec_stay'} == 3) { }
812 2419 elsif ($self->{'spec_stay'} == 4) { }
13 2406 elsif ($self->{'char'} eq ']') { }
409 1997 elsif ($self->{'tag_length'} > 1 and _is_in_tag_name($self->{'char'})) { }
217 4 26 if ($self->{'brace'} == 0 and $self->{'bracket'} == 0 and $self->{'spec_stay'} < 3 or $self->{'spec_stay'} == 3 and join($EMPTY_STR, @{$$self{'data'};}[-2, -1]) eq '--' or $self->{'tag_type'} =~ /^!\[cdata\[/ms and join($EMPTY_STR, @{$$self{'data'};}[-2, -1]) eq ']]')
237 89 1 if ($self->{'spec_stay'} != 4)
246 0 56 if ($self->{'tag_length'} == 0 and join($EMPTY_STR, @{$$self{'data'};}[-2, -1]) eq '--')
257 34 778 if ($self->{'char'} eq $self->{'quote'})
272 6 403 if ($self->{'tag_length'} == 2 || $self->{'tag_length'} == 3 and $self->{'char'} eq '-')
278 7 402 if ($self->{'char'} eq '[')
286 30 1967 if ($self->{'quote'} eq $EMPTY_STR and $self->{'char'} eq '"')
293 4 1993 if ($self->{'quote'} eq $EMPTY_STR and $self->{'char'} eq q['])
300 22 1975 if ($self->{'char'} eq '<')
303 5 1992 if ($self->{'char'} eq '[')
312 4414 55 if ($self->{'stay'} != 99) { }
313 689 3725 if (exists $self->{'text'})
314 689 0 if (length $self->{'text'} > 1) { }
321 55 0 if (exists $self->{'filename'} and defined $self->{'char'})
327 166 4303 if ($self->{'stay'} == 98 or $self->{'stay'} == 99)
328 55 111 if ($self->{'stay'} == 99)
334 89 4380 if ($self->{'char'} eq "\n")
345 29 0 if ($char eq '!' or $char eq '/' or $char eq '?' or $char =~ /^[\d\w]+$/ms)
356 639 76 if ($char eq ':' or $char eq '[' or $char eq '-' or $char eq '%' or $char =~ /^[\d\w]+$/ms)
367 111 2320 if ($self->{'tag_length'} > 0)