Branch Coverage

blib/lib/Mock/Data/Regex.pm
Criterion Covered Total %
branch 139 198 70.2


line true false branch
20 0 2 @_ == 1 ? :
22 2 @_ == 1 && (!ref($_[0]) || ref $_[0] eq 'Regexp') ? :
24 0 24 if (ref $class)
27 0 0 if ($self{'regex'} == $class->{'regex'} xor $self{'regex_parse_tree'} == $class->{'regex_parse_tree'})
28 0 0 if $self{'regex_parse_tree'} == $class->{'regex_parse_tree'}
29 0 0 if $self{'regex'} == $class->{'regex'}
34 0 24 unless defined $self{'regex'}
35 0 24 unless ref $self{'regex'} eq "Regexp"
38 3 21 if $self{'regex_parse_tree'}->flags->{'a'}
40 0 24 if defined $self{'prefix'}
41 0 24 if defined $self{'suffix'}
59 209 0 unless $_[0]{'max_repetition'}
63 0 0 if (@_ > 1)
70 0 0 if (@_ > 1)
79 23 186 ref $_[0] eq 'HASH' ? :
86 0 209 unless $self->regex_parse_tree->generate($out) and !$out->next_req || grep(($_ eq ''), @{$out->next_req;})
90 190 19 unless defined $prefix or defined $suffix
95 19 0 if ($prefix and !$out->start || $out->start eq 'LF')
97 1 18 if $out->start
102 18 1 if ($suffix and !$out->next_req || grep(($_ eq "\n"), @{$out->next_req;}) && !$out->require->[1])
103 2 16 if $out->next_req
118 0 0 builtin::blessed($p) && $p->isa('Mock::Data::Charset') ? :
136 62 295 if (/\G \( /cgx) { }
62 233 elsif (/\G(?= \) )/cgx) { }
11 222 elsif (/\G \| /cgx) { }
31 191 elsif (/\G ( \[ | \\w | \\W | \\s | \\S | \\d | \\D | \\N | \\Z | \. | \^ | \$ ) /cgx) { }
30 161 elsif (/\G ( \? | \* \?? | \+ \?? | \{ ([0-9]+)? (,)? ([0-9]+)? \} ) /cgx) { }
0 161 elsif ($flags->{'x'} and /\G ( \s | [#].* ) /cgx) { }
118 43 elsif (/\G (\\)? (.) /cgsx) { }
138 43 19 if (/\G \? /cgx)
140 43 0 if (/\G \^ ( \w* ) : /cgx) { }
0 0 elsif ($] < 5.02 and /\G (\w*)-\w* : /cgx) { }
152 0 62 unless /\G \) /cgx
167 5 26 if ($1 eq '[') { }
11 15 elsif (ord $1 == 92) { }
2 13 elsif ($1 eq '.') { }
7 6 elsif ($1 eq '$') { }
6 0 elsif ($1 eq '^') { }
173 1 10 if ($1 eq '\\Z') { }
181 0 2 $flags->{'s'} ? :
184 4 3 $flags->{'m'} ? :
187 4 2 $flags->{'m'} ? :
193 1 29 if ($1 eq '?') { }
5 24 elsif (ord $1 == 42) { }
19 5 elsif (ord $1 == 43) { }
203 3 2 $3 ? :
206 0 30 if (not @$expr) { }
6 24 elsif (not ref $expr->[-1]) { }
212 2 4 if (length $expr->[-1] > 1) { }
228 0 118 if $_regex_syntax_unsupported{$1 or ""}{$2}
230 5 113 if ($1 and defined(my $equiv = $_parse_regex_backslash{$2})) { }
231 3 2 ref $equiv ? :
235 3 115 if ($flags->{'i'} and uc $ch ne lc $ch) { }
53 62 elsif (@$expr and not ref $expr->[-1]) { }
249 5 0 if @$expr
38 62 @$expr > 1 || !ref($expr->[0]) ? :
5 100 @or ? :
268 15 5 @_ > 1 ? :
305 30 428 if (@_ > 1)
310 0 30 if (my $rep = $_[0]{'repetition'}) { }
312 0 0 defined $rep->[$_] && defined $val->[$_] ? :
321 0 0 $_[0]{'repetition'} ? :
324 0 0 $_[0]{'repetition'} ? :
329 84 251 if (my $rep = $self->repetition) { }
332 248 68 $_ > $min ? :
336 20 316 ref $_ ? :
338 298 18 if $success
340 18 0 if ($origin)
350 180 259 ref $_ ? :
14 425 unless ref $_ ? $_->generate($out) : $out->append($_)
368 30 2 if (my $rep = $self->{'repetition'})
380 114 0 ref $pick ? :
100 14 if ref $pick ? $pick->generate($out) : $out->append($pick)
386 14 0 ref $_ ? :
14 0 if ref $_ ? $_->generate($out) : $out->append($_)
389 0 0 if ($_ > $min)
410 20 0 if (ref $self->{'pattern'} eq "HASH")
411 3 17 if $self->{'flags'}{'a'}
420 0 84 if (my $req = $out->next_req)
423 0 0 unless (ref $_)
425 0 0 if length $_ == 0 and $self->min_repetition == 0
426 0 0 if length $_ == 1 and $self->pattern->has_member($_) or length $_ > 1 and not grep((!$self->pattern->has_member($_)), split(//, $_, 0))
450 47 39 if ($self->{'start'})
453 14 14 unless length $out->str == 0 or $self->{'start'} eq "LF" and substr($out->str, -1) eq "\n"
456 19 14 if length $out->str == 0 and not $out->start
458 39 33 if ($self->{'end'})
461 39 0 unless $self->{'end'} eq 1
463 19 20 unless $self->{'end'} eq "LF"
487 19 420 if @_ > 1
491 40 158 unless defined $rep
492 26 132 if defined $rep->[1]
495 132 0 if ord $range == 43
498 0 0 $range > 0 ? :
502 58 3 if @_ > 1
510 18 641 if (my $req = $self->next_req)
515 36 0 if (not ref $_) { }
516 0 36 if (length $_ and $content eq $_)
536 18 344 $req ? :
542 0 32 unless \$self->{'str'} == $origin->[0]