Branch Coverage

blib/lib/Data/Random/String/Matches.pm
Criterion Covered Total %
branch 225 268 83.9


line true false branch
187 1 214 unless defined $regex
190 194 20 ref $regex eq 'Regexp' ? :
220 4122 2 if (defined $str and $str =~ /^$regex$/)
225 0 0 if ($ENV{'DEBUG_REGEX_GEN'} and $@)
232 0 1010 if $str =~ /^$regex$/
246 0 1010 if ($regex_str =~ /\\d/ or $regex_str =~ /\[0-9\]/ or $regex_str =~ /\[\^[^\]]*[A-Za-z]/) { }
0 1010 elsif ($regex_str =~ /\[A-Z\]/ or $regex_str =~ /\[A-Z[^\]]*\]/) { }
0 1010 elsif ($regex_str =~ /\[a-z\]/ or $regex_str =~ /\[a-z[^\]]*\]/) { }
0 1010 elsif ($regex_str =~ /\\w/ or $regex_str =~ /\[a-zA-Z0-9_\]/) { }
316 3 21 unless defined $count and $count > 0
320 6 15 if ($unique) { }
332 1 5 if (keys %seen < $count)
368 1 11 unless defined $seed
398 1 20 if ($info->{'complexity'} eq "very_complex")
411 0 20 if ($info->{'features'}{'has_backreferences'} and $pattern =~ /(\(\w+\)).*\\\d+/)
425 8 12 if ($pattern =~ /\{(\d+),(\d+)\}/)
427 6 2 if ($max - $min > 10)
443 2 12 if ($info->{'features'}{'has_alternation'})
445 1 1 if (@alts > 10)
458 1 0 if ($pattern =~ /\(([a-zA-Z])\|([a-zA-Z])\|([a-zA-Z])\)/)
474 3 9 if ($info->{'features'}{'has_lookahead'} or $info->{'features'}{'has_lookbehind'})
479 3 0 if ($simpler ne $pattern)
492 2 7 if ($info->{'features'}{'has_unicode'} and $pattern =~ /\\p\{L\}/)
506 0 7 if ($pattern =~ /([a-zA-Z]{20,})/)
536 1 67 unless defined $string
563 3 38 if $self->{'_pattern_info_cache'}
571 6 32 $pattern =~ /\|/ ? :
4 34 $pattern =~ /(\\[1-9]|\\k<)/ ? :
4 34 $pattern =~ /\\p\{/ ? :
4 34 $pattern =~ /\(\?[=!]/ ? :
1 37 $pattern =~ /\(\?<[=!]/ ? :
4 34 $pattern =~ /\(\?
2 36 $pattern =~ /(?:[+*?]\+|\{\d+(?:,\d*)?\}\+)/ ? :
609 156 66 if (defined $1 or defined $2 and $2) { }
36 30 elsif (defined $3) { }
614 16 20 if ($last_was_atom) { }
617 2 14 defined $4 ? :
622 8 12 defined $4 ? :
636 0 38 if $min < 0
637 0 38 if $max < $min
651 6 32 if $features->{'has_alternation'}
652 4 34 if $features->{'has_backreferences'}
653 4 34 if $features->{'has_unicode'}
654 4 34 if $features->{'has_lookahead'}
655 1 37 if $features->{'has_lookbehind'}
656 4 34 if $features->{'has_named_groups'}
657 2 36 if $features->{'has_possessive'}
660 23 15 if $score < 3
661 12 3 if $score < 7
662 2 1 if $score < 12
695 940 4877 if ($char eq '\\') { }
3935 942 elsif ($char eq '[') { }
151 791 elsif ($char eq '(') { }
2 789 elsif ($char eq '.') { }
0 789 elsif ($char eq '|') { }
1 788 elsif ($char =~ /[+*?]/ or $char eq '{') { }
719 69 elsif ($char =~ /[\w ]/) { }
700 30 910 if ($next =~ /[1-9]/) { }
7 903 elsif ($next eq 'k' and substr($pattern, $i + 1, 1) eq '<') { }
25 878 elsif ($next eq 'p' and substr($pattern, $i + 1, 1) eq '{') { }
730 148 elsif ($next eq 'd') { }
35 113 elsif ($next eq 'w') { }
2 111 elsif ($next eq 's') { }
2 109 elsif ($next eq 'D') { }
2 107 elsif ($next eq 'W') { }
2 105 elsif ($next eq 't') { }
2 103 elsif ($next eq 'n') { }
0 103 elsif ($next eq 'r') { }
703 30 0 if (exists $self->{'backrefs'}{$ref_num}) { }
712 7 0 if (exists $self->{'named_refs'}{$name}) { }
769 0 3935 if $end == -1
780 0 151 if $end == -1
791 2 149 if ($group_content =~ /^\?:/) { }
15 134 elsif ($group_content =~ /^\?<([^>]+)>/) { }
6 128 elsif ($group_content =~ /^\?=/) { }
1 127 elsif ($group_content =~ /^\?!/) { }
1 126 elsif ($group_content =~ /^\?<=/) { }
1 125 elsif ($group_content =~ /^\?
824 7 144 if ($is_lookahead) { }
2 142 elsif ($is_lookbehind) { }
827 6 1 unless ($is_negative)
843 88 54 if ($group_content =~ /\|/) { }
850 140 2 if ($is_capturing)
854 15 125 if (defined $group_name)
901 3912 1682 if ($check_possessive and $pos + 2 < length $pattern)
903 6 3906 if ($next =~ /[+*?]/ || $next eq '}' and $after_next eq "+")
908 3451 2143 if ($next eq '{') { }
22 2121 elsif ($next eq '+') { }
3 2118 elsif ($next eq '*') { }
4 2114 elsif ($next eq '?') { }
910 0 3451 if $end == -1
914 2 3449 if ($check_possessive and $end + 1 < length $pattern and substr($pattern, $end + 1, 1) eq "+")
920 3392 59 if ($quant =~ /^(\d+)$/) { }
59 0 elsif ($quant =~ /^(\d+),(\d+)$/) { }
0 0 elsif ($quant =~ /^(\d+),$/) { }
936 4 18 if ($is_possessive)
946 1 2 if ($is_possessive)
956 1 3 if ($is_possessive)
959 3 1 rand() < 0.5 ? :
976 4 1004 if ($char eq '(') { }
4 1000 elsif ($char eq ')') { }
162 838 elsif ($char eq '|' and $depth == 0) { }
989 88 0 if length $current
1002 3935 21112 if ($char eq '[' and $i == $start || substr($pattern, $i - 1, 1) ne '\\') { }
3935 34354 elsif ($char eq ']' and substr($pattern, $i - 1, 1) ne '\\') { }
1006 3935 0 if $depth == 0
1018 1619 131 $i > 0 ? :
1020 156 1594 if ($char eq '(' and $prev ne '\\') { }
156 2876 elsif ($char eq ')' and $prev ne '\\') { }
1024 151 5 if $depth == 0
1037 0 17179 if $ENV{'DEBUG_REGEX_GEN'}
1041 10 17169 if (substr($class, 0, 1) eq "^")
1051 0 33352 if $ENV{'DEBUG_REGEX_GEN'}
1053 159 33193 if ($char eq '\\') { }
30522 2671 elsif ($i + 2 < length $class and substr($class, $i + 1, 1) eq '-') { }
1056 0 159 if $ENV{'DEBUG_REGEX_GEN'}
1057 16 143 if ($next eq 'd') { }
10 133 elsif ($next eq 'w') { }
0 133 elsif ($next eq 's') { }
6 127 elsif ($next eq 'p' and substr($class, $i + 1, 1) eq '{') { }
1078 0 30522 if ($end_char eq '\\' or $end_char eq ']') { }
30522 0 elsif (ord $end_char >= ord $char) { }
1097 0 17179 if $ENV{'DEBUG_REGEX_GEN'}
1099 10 17169 if ($negate)
1104 17179 0 @chars ? :
1110 95 0 @chars ? :
1117 88 13 if ($prop eq 'L' or $prop eq 'Letter') { }
3 10 elsif ($prop eq 'N' or $prop eq 'Number') { }
6 4 elsif ($prop eq 'Lu' or $prop eq 'Uppercase_Letter') { }
4 0 elsif ($prop eq 'Ll' or $prop eq 'Lowercase_Letter') { }
0 0 elsif ($prop eq 'P' or $prop eq 'Punctuation') { }
0 0 elsif ($prop eq 'S' or $prop eq 'Symbol') { }
0 0 elsif ($prop eq 'Z' or $prop eq 'Separator') { }
0 0 elsif ($prop eq 'Nd' or $prop eq 'Decimal_Number') { }