Branch Coverage

blib/lib/Mock/Data/Regex.pm
Criterion Covered Total %
branch 138 198 69.7


line true false branch
20 0 2 @_ == 1 ? :
20 2 @_ == 1 && (!ref($_[0]) || ref $_[0] eq 'Regexp') ? :
24 0 22 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 22 unless defined $self{'regex'}
35 0 22 unless ref $self{'regex'} eq 'Regexp'
38 3 19 if $self{'regex_parse_tree'}->flags->{'a'}
40 0 22 if defined $self{'prefix'}
41 0 22 if defined $self{'suffix'}
59 205 0 unless $_[0]{'max_repetition'}
63 0 0 if (@_ > 1)
70 0 0 if (@_ > 1)
79 23 182 ref $_[0] eq 'HASH' ? :
86 0 205 unless $self->regex_parse_tree->generate($out) and !$out->next_req || grep(($_ eq ''), @{$out->next_req;})
90 186 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 &Scalar::Util::blessed($p) && $p->isa('Mock::Data::Charset') ? :
136 51 169 if (/\G \( (\?)? /cgx)
138 40 11 if (defined $1)
140 40 0 if (/\G \^ ( \w* ) : /cgx) { }
0 0 elsif ($] < 5.02 and /\G (\w*)-\w* : /cgx) { }
152 0 51 unless /\G \) /cgx
156 56 164 if (/\G ( [|)] ) /cgx) { }
25 139 elsif (/\G ( \[ | \\w | \\W | \\s | \\S | \\d | \\D | \\N | \\Z | \. | \^ | \$ ) /cgx) { }
24 115 elsif (/\G ( \? | \* \?? | \+ \?? | \{ ([0-9]+)? (,)? ([0-9]+)? \} ) /cgx) { }
0 115 elsif ($flags->{'x'} and /\G ( \s | [#].* ) /cgx) { }
75 40 elsif (/\G (\\)? (.) /cgsx) { }
158 51 5 if ($1 eq ')')
169 5 20 if ($1 eq '[') { }
5 15 elsif (ord $1 == 92) { }
2 13 elsif ($1 eq '.') { }
7 6 elsif ($1 eq '$') { }
6 0 elsif ($1 eq '^') { }
175 1 4 if ($1 eq '\\Z') { }
183 0 2 $flags->{'s'} ? :
186 4 3 $flags->{'m'} ? :
189 4 2 $flags->{'m'} ? :
195 1 23 if ($1 eq '?') { }
5 18 elsif (ord $1 == 42) { }
13 5 elsif (ord $1 == 43) { }
205 3 2 $3 ? :
208 0 24 if (not @$expr) { }
6 18 elsif (not ref $expr->[-1]) { }
214 2 4 if (length $expr->[-1] > 1) { }
230 0 75 if $_regex_syntax_unsupported{$1 or ''}{$2}
232 5 70 if ($1 and defined(my $equiv = $_parse_regex_backslash{$2})) { }
233 3 2 ref $equiv ? :
237 3 72 if ($flags->{'i'} and uc $ch ne lc $ch) { }
22 50 elsif (@$expr and not ref $expr->[-1]) { }
251 3 0 if @$expr
35 53 @$expr > 1 || !ref($expr->[0]) ? :
3 88 @or ? :
270 9 5 @_ > 1 ? :
307 24 424 if (@_ > 1)
312 0 24 if (my $rep = $_[0]{'repetition'}) { }
314 0 0 defined $rep->[$_] && defined $val->[$_] ? :
323 0 0 $_[0]{'repetition'} ? :
326 0 0 $_[0]{'repetition'} ? :
331 82 259 if (my $rep = $self->repetition) { }
334 259 66 $_ > $min ? :
338 20 325 ref $_ ? :
340 306 19 if $success
342 19 0 if ($origin)
352 177 256 ref $_ ? :
23 410 unless ref $_ ? $_->generate($out) : $out->append($_)
370 30 0 if (my $rep = $self->{'repetition'})
382 117 0 ref $pick ? :
94 23 if ref $pick ? $pick->generate($out) : $out->append($pick)
388 23 0 ref $_ ? :
23 0 if ref $_ ? $_->generate($out) : $out->append($_)
391 0 0 if ($_ > $min)
412 14 0 if (ref $self->{'pattern'} eq 'HASH')
413 3 11 if $self->{'flags'}{'a'}
422 0 76 if (my $req = $out->next_req)
425 0 0 unless (ref $_)
427 0 0 if length $_ == 0 and $self->min_repetition == 0
428 0 0 if length $_ == 1 and $self->pattern->has_member($_) or length $_ > 1 and not grep((!$self->pattern->has_member($_)), split(//, $_, 0))
452 56 39 if ($self->{'start'})
455 23 14 unless length $out->str == 0 or $self->{'start'} eq 'LF' and substr($out->str, -1) eq "\n"
458 19 14 if length $out->str == 0 and not $out->start
460 39 33 if ($self->{'end'})
463 39 0 unless $self->{'end'} eq 1
465 19 20 unless $self->{'end'} eq 'LF'
489 19 434 if @_ > 1
493 40 148 unless defined $rep
494 26 122 if defined $rep->[1]
497 122 0 if ord $range == 43
500 0 0 $range > 0 ? :
504 58 3 if @_ > 1
512 19 638 if (my $req = $self->next_req)
517 38 0 if (not ref $_) { }
518 0 38 if (length $_ and $content eq $_)
538 19 357 $req ? :
544 0 42 unless \$self->{'str'} == $origin->[0]