Branch Coverage

blib/lib/YAPE/Regex.pm
Criterion Covered Total %
branch 99 220 45.0


line true false branch
79 0 1 unless $INC{$file}
80 0 1 if ($class ne 'YAPE::Regex')
93 0 12 if not defined $regex or length $regex == 0
96 12 0 if ref $regex ne 'Regexp'
98 3 9 if $@
102 0 12 if ($regex =~ / ^ \( \? \^ ([imsx]+) (: .*) $ /x) { }
9 3 elsif ($regex =~ / ^ \( \? \^ : /x) { }
106 0 0 if (length $inverted) { }
148 10 0 if $_[0]->done
153 10 101 unless length $$self{'CONTENT'}
155 0 89 if (@{$$self{'TREE_STACK'};} and $$self{'TREE_STACK'}[-1]{'MODE'}{'x'} and $$self{'CONTENT'} =~ s/^(\s+)//)
165 0 101 if ($$self{'CONTENT'} =~ s/^$pat{'Pcomment'}//)
172 0 89 if (@{$$self{'TREE_STACK'};} and $$self{'TREE_STACK'}[-1]{'MODE'}{'x'} and $$self{'CONTENT'} =~ s/^$pat{'Xcomment'}//)
183 0 101 if ($$self{'CONTENT'} =~ s/^$pat{'anchor'}//)
186 0 0 if $quant eq -1
193 0 101 if ($$self{'CONTENT'} =~ s/^$pat{'macro'}//)
196 0 0 if $quant eq -1
203 0 101 if ($$self{'CONTENT'} =~ s/^$pat{'oct'}//)
206 0 0 if $quant eq -1
213 1 100 if ($$self{'CONTENT'} =~ s/^$pat{'hex'}//)
222 0 100 if ($$self{'CONTENT'} =~ s/^$pat{'utf8hex'}//)
231 1 99 if ($$self{'CONTENT'} =~ s/^$pat{'backref'}//)
234 0 1 if $quant eq -1
238 0 1 if ($self->isa('YAPE::Regex::Reverse'))
239 0 0 if ($quant eq '*' or $quant eq '+') { }
0 0 elsif ($quant and $quant ne '?') { }
241 0 0 if $quant eq '*'
250 0 0 unless $l
251 0 0 if $l
0 0 if $u
263 0 99 if ($$self{'CONTENT'} =~ s/^$pat{'ctrl'}//)
266 0 0 if $quant eq -1
273 0 99 if ($$self{'CONTENT'} =~ s/^$pat{'named'}//)
276 0 0 if $quant eq -1
283 0 99 if ($$self{'CONTENT'} =~ s/^$pat{'Cchar'}//)
285 0 0 if $quant eq -1
292 6 93 if ($$self{'CONTENT'} =~ s/^$pat{'class'}//)
293 0 6 defined $1 ? :
294 0 6 if defined $1
297 0 6 if $quant eq -1
298 0 6 unless $self->_ok_class($match)
305 0 93 if ($$self{'CONTENT'} =~ s/^$pat{'slash'}//)
308 0 0 if $quant eq -1
315 0 93 if ($$self{'CONTENT'} =~ s/^$pat{'any'}//)
317 0 0 if $quant eq -1
324 0 81 if (@{$$self{'TREE_STACK'};} and $$self{'TREE_STACK'}[-1]{'MODE'}{'x'} and $$self{'CONTENT'} =~ s/^$pat{'nws'}//)
332 0 0 if (length $match > 1 and $$self{'CONTENT'} =~ /^(?:$pat{'Pcomment'}|$pat{'Xcomment'}|\s+)*$pat{'quant'}/) { }
338 0 0 if $quant eq -1
347 26 67 if ($$self{'CONTENT'} =~ s/^$pat{'reg'}//)
350 0 26 if (length $match > 1 and $$self{'CONTENT'} =~ /^$pat{'quant'}/) { }
356 1 25 if $quant eq -1
364 4 63 if ($$self{'CONTENT'} =~ s/^$pat{'alt'}//)
365 0 4 if (@{$$self{'TREE_STACK'};} and $$self{'TREE_STACK'}[-1]->type eq 'cond' and $$self{'TREE_STACK'}[-1]{'OPTS'} == 2)
374 1 3 if (@{$$self{'TREE_STACK'};} and $$self{'TREE_STACK'}[-1]->type eq 'cond') { }
388 0 63 if ($$self{'CONTENT'} =~ s/^$pat{'Pflags'}//)
399 7 56 if ($$self{'CONTENT'} =~ s/^$pat{'Pcond'}//)
400 1 6 if (defined $1) { }
403 1 0 if @{$$self{'TREE_STACK'};}
414 6 0 if @{$$self{'TREE_STACK'};}
424 0 56 if ($$self{'CONTENT'} =~ s/^$pat{'Pcut'}//)
426 0 0 if $quant eq -1
437 3 53 if ($$self{'CONTENT'} =~ s/^$pat{'Pahead'}//)
438 2 1 $1 eq '=' ? :
448 3 50 if ($$self{'CONTENT'} =~ s/^$pat{'Pbehind'}//)
449 2 1 $1 eq '=' ? :
459 13 37 if ($$self{'CONTENT'} =~ s/^$pat{'Pgroup'}//)
463 1 12 if @{$$self{'TREE_STACK'};}
474 2 35 if ($$self{'CONTENT'} =~ s/^$pat{'Pcapture'}//)
477 2 0 if @{$$self{'TREE_STACK'};}
487 2 33 if ($$self{'CONTENT'} =~ s/^$pat{'Pcode'}//)
488 0 2 unless (my($code, $left) = extract_codeblock($$self{'CONTENT'}))
503 2 31 if ($$self{'CONTENT'} =~ s/^$pat{'Plater'}//)
504 0 2 unless (my($code, $left) = extract_codeblock($$self{'CONTENT'}))
519 30 1 if ($$self{'DEPTH'}-- and $$self{'CONTENT'} =~ s/^$pat{'Pclose'}//)
521 0 30 if $quant eq -1
529 0 30 if ($self->isa('YAPE::Regex::Reverse'))
530 0 0 if ($quant eq '*' or $quant eq '+') { }
0 0 elsif ($quant and $quant ne '?') { }
536 0 0 if $quant eq '*'
550 0 0 unless $l
551 0 0 if $l
0 0 if $u
560 6 24 if (@{$$self{'TREE_STACK'};} and $$self{'TREE_STACK'}[-1]->type eq 'cond' and $$self{'TREE_STACK'}[-1]{'OPTS'} == 1) { }
598 7 57 if ($$self{'CONTENT'} =~ s/^($pat{'Pcomment'})?$pat{'quant'}// or @{$$self{'TREE_STACK'};} and $$self{'TREE_STACK'}[-1]{'MODE'}{'x'} and $$self{'CONTENT'} =~ s/^($pat{'Xcomment'}?\s*)?$pat{'quant'}//)
605 1 6 if ($quant =~ /^\{(\d+),(\d+)\}/ and $1 > $2)
611 0 6 if $1
615 0 63 if @{$$self{'TREE_STACK'};} and $$self{'TREE_STACK'}[-1]{'MODE'}{'x'} and $$self{'CONTENT'} =~ s/^(\s+)//
619 0 63 if (@{$$self{'TREE_STACK'};} and $$self{'TREE_STACK'}[-1]{'MODE'}{'x'} and $$self{'CONTENT'} =~ s/^($pat{'Xcomment'}?\s*)?$pat{'ngreed'}// or $$self{'CONTENT'} =~ s/^($pat{'Pcomment'})?$pat{'ngreed'}//)
625 0 0 if $1
628 0 63 if $ws
640 30 0 defined $10 ? :
0 30 defined $6 ? :
0 30 defined $5 ? :
0 30 defined $4 ? :
0 30 defined $3 ? :
0 30 defined $2 ? :
651 0 30 if defined $utf8
653 0 30 if (defined $posix and not $posix =~ /$valid_POSIX/)
659 0 30 if ($class =~ s/^-($ok_cc_REx)//)
661 0 0 defined $10 ? :
0 0 defined $6 ? :
0 0 defined $5 ? :
0 0 defined $4 ? :
0 0 defined $3 ? :
0 0 defined $2 ? :
672 0 0 if defined $utf8
674 0 0 if (defined $posix and not $posix =~ /$valid_POSIX/)
680 0 0 if ($a == -1 or $b == -1) { }
0 0 elsif ($a > $b) { }
681 0 0 if $^W