Branch Coverage

blib/lib/Regexp/ERE.pm
Criterion Covered Total %
branch 541 632 85.6


line true false branch
327 3052 1 if ($$interval[1] < $sorted[$i][1])
341 85 1175 unless (@$char_class)
344 1107 68 if ($$char_class[0][0] != 0)
352 1107 68 if ($$char_class[$i][1] != 1114111)
385 291 171 if ($i_0 < @$char_class_0 and $i_1 < @$char_class_1 and $$char_class_1[$i_1][0] <= $$char_class_0[$i_0][1])
412 84 207 $$char_class_0[$i_0][0] > $$char_class_1[$i_1][0] ? :
419 186 105 if ($$char_class_0[$i_0][1] <= $$char_class_1[$i_1][1])
424 208 83 if ($$char_class_1[$i_1][1] <= $$char_class_0[$i_0][1])
429 186 105 if ($interval_0_done)
430 208 83 if ($interval_1_done)
442 46713 91989 if ($c < $$interval[0]) { }
27658 64331 elsif ($c <= $$interval[1]) { }
466 31 57 unless (cc_match($char_class_1, $c))
478 0 564 if (@$char_class and $$char_class[0][0] < 0)
479 0 0 if ($$char_class[0][0] == -2) { }
480 0 0 if ($$char_class[0][1] == -1) { }
488 0 0 if ($$char_class[0][1] == -2) { }
497 524 40 if (@$char_class)
498 491 33 if (@$char_class == 1 and $$char_class[0][0] == $$char_class[0][1]) { }
4 29 elsif (@$char_class == 1 and $$char_class[0][0] == 0 and $$char_class[0][1] == 1114111) { }
8 21 elsif ($$char_class[$#$char_class][1] == 1114111) { }
503 115 376 if ($to_perlre) { }
507 375 1 $c =~ /$ERE_literal/o ? :
522 2 6 if ($to_perlre) { }
534 18 3 if ($to_perlre) { }
544 40 524 if (@items == 0) { }
524 0 elsif (@items == 1) { }
551 0 0 if ($to_perlre) { }
566 6 5 if ($$_[0] == $$_[1]) { }
567 0 6 if ($$_[0] == 45) { }
0 6 elsif ($$_[0] == 93) { }
580 0 5 if ($$_[0] == 45 or $$_[0] == 93) { }
584 0 0 if ($$_[0] == 45) { }
590 0 0 if ($$_[1] == $$_[0] + 1) { }
0 0 elsif ($$_[1] == $$_[0] + 2) { }
601 4 1 if ($$_[1] == $$_[0] + 1) { }
612 0 9 if ($has_minus)
613 0 9 if ($has_r_bracket)
621 44 5 if ($$_[0] == $$_[1]) { }
623 0 44 $c =~ /$PERLRE_char_class_special/o ? :
627 0 5 $c1 =~ /$PERLRE_char_class_special/o ? :
4 1 $$_[0] + 1 < $$_[1] ? :
0 5 $c2 =~ /$PERLRE_char_class_special/o ? :
691 203 602 $state_ind_map && exists $$state_ind_map{$$_[1]} ? :
701 146 64 $state_ind_map && exists $$state_ind_map{$$t_0[1]} ? :
706 184 26 unless (exists $state_ind_to_t_1{$state_ind_0})
708 16 10 unless (cc_is_subset($$t_0[0], $$t_1[0]))
736 1012 6071 if (exists $$state_ind_to_equiv{$$_[1]}) { }
753 799 3120 if (keys %equiv_index_to_char_classes)
759 114 524 exists $equiv_index_to_char_classes{$_} ? :
769 791 16 @{$equiv_index_to_char_classes{$_};} == 1 ? :
815 11 4 !($prev_has_suffix && _nfa_has_prefix($nfa)) ? :
9 15 !($next_has_prefix && _nfa_has_suffix($nfa)) ? :
244 24 $min == 0 ? :
830 13 255 if ($min_left > 0)
833 267 1 if (length $max == 0 or $max > $min)
834 7 260 if ($$nfa[0][0]) { }
249 11 elsif (not grep({$$_[1] == 0;} map({@{$$_[1];};} @$nfa))) { }
864 253 15 if (length $max == 0) { }
14 1 elsif ($max > $min) { }
876 248 5 if (_transitions_is_subset($$optional_part[$_][1], $$optional_part[0][1], {$_, 0})) { }
889 2 3 if (grep {exists $root_index_to_char_class{$_};} map({$$_[1];} @{$$optional_part[$_][1];})) { }
909 2 2 @{$new_index_to_char_classes{$_};} == 1 ? :
923 248 5 keys %$state_ind_to_equiv ? :
937 13 255 if ($min_right > 0)
940 245 23 @quant_parts == 1 ? :
961 0 314 unless (@_)
988 174 884 if ($$_[1] += $init_state_ind) == $init_state_ind
994 244 264 if (@{$$state[1];} <= 1 and _transitions_is_subset($$state[1], $$nfa[0][1], {$acc_ind, $init_state_ind})) { }
14 250 elsif (grep {$$_[1] == $init_state_ind;} @{$$nfa[0][1];} and cc_is_subset(map({$$_[0];} grep({$$_[1] == $init_state_ind;} @{$$nfa[0][1];})), map({$$_[0];} grep({$$_[1] == $acc_ind;} @{$$state[1];})))) { }
1096 145 254 if (not $init_reachable || $init_equiv_reachable or $init_skipped == @accepting_state_inds)
1104 204 195 if (not $$nfa[0][0]) { }
13 182 elsif ($starifying) { }
1114 13 0 unless ($init_reachable)
1130 256 58 if (keys %$state_ind_to_equiv) { }
1163 57 243 if (@$nfa == 1 and @{$$nfa[0][1];} == 0)
1178 164 1097 if ($$orig_state[0] and not @{$$orig_state[1];}) { }
1182 87 77 if (defined $first_trivial_accepting_state_ind) { }
1193 31 1280 if ($$_[1] += $init_state_ind) == $init_state_ind
1202 214 29 unless ($init_reachable)
1207 120 10 if (keys %$state_ind_to_equiv) { }
1276 2936 2868 if (($char_class = ($cached_cc_inter2{$$t_0[0]}{$$t_1[0]} ||= &cc_inter2($$t_0[0], $$t_1[0]))) != $cc_none)
1287 1403 1533 unless (exists $todo_seen{$to_state_ind})
1295 26 1402 if ($accepting = $nfa_0_accepting && $nfa_1_accepting)
1314 0 25 if (keys %livings == 0)
1352 3 0 unless (exists $begs{$_})
1366 10 28 if ($$nfa[$from_state_ind][0])
1378 0 0 unless (exists $livings{$_})
1386 1 9 scalar grep({$$nfa[$_][0];} keys %begs) ? :
9 1 unless ($accept_empty = scalar grep({$$nfa[$_][0];} keys %begs) ? 1 : 0)
1396 14 0 unless (exists $begs{$_} or exists $begends{$_})
1397 3 11 if ($$nfa[$_][0])
1420 9 22 if ($$_[0][0][0] >= 0) { }
22 0 elsif (@{$$_[0];} == 1) { }
1439 8 2 if (@{$$nfa[0][1];}) { }
1455 8 0 if ($clone_reachable)
1465 0 8 if ($$nfa[0][0])
1481 2 8 if (keys %begs > 1)
1494 4 6 if ($$nfa[0][0] = $accept_empty)
1507 14 11 unless (exists $reachables{$_})
1521 5 3 unless (exists $livings{$_})
1528 4 6 if (keys %livings == 0) { }
0 6 elsif (keys %livings == @$nfa) { }
1582 0 0 $$nfa[$i][0] ? :
1617 0 582 if ($$state1[0] != $$state2[0])
1624 0 582 if (@$transitions1 != @$transitions2)
1630 0 1661 if ($cc1 ne $cc2)
1633 1177 484 if (exists $nfa1_nfa2_indexes{$next_index1}) { }
0 484 elsif (exists $nfa2_nfa1_indexes{$next_index2}) { }
1634 0 1177 if ($nfa1_nfa2_indexes{$next_index1} != $next_index2)
1684 0 30149 unless $$a[0] <=> $$b[0]
1730 446 4307 if ($j < @sorted and $sorted[$j][0] <= $sorted[$i][1])
1741 0 446 if ($sorted[$i][1] != $sorted[$j][1])
1771 0 205 unless (@$nfa)
1784 271 1051 scalar grep({$$_[0];} @nfa_states) ? :
1803 1117 3205 unless (exists $dfa_indexes{$next_index_key})
1821 1177 145 if ((my $all_cc = cc_union(@any_ccs)) != $cc_any)
1829 195 10 if ($trap_needed)
1864 271 1246 if ($$dfa[$index][0]) { }
1873 199 6 if (@non_acceptings) { }
1884 89187 825096 if exists $indexes{$$_[1]}
1896 21324 247752 if (exists $prev_inds{$_}) { }
1903 126548 795 if (not @inter && @diff) { }
1909 0 795 if ($todo{$prev_inds_key}) { }
177 618 elsif (@diff < @inter) { }
1990 152 770 if ($$nfa[$i][0])
2013 411 511 unless (exists $$path{$first})
2016 0 271 unless keys %{$$path_tr{$b};} <=> keys %{$$path_tr{$a};}
2032 165 296 if (keys %{$$path_tr{$i};} != 1)
2033 69 96 if ($i != $first and not $todo_sorted and @todo)
2036 0 40 unless keys %{$$path_tr{$b};} <=> keys %{$$path_tr{$a};}
2056 107 299 if (keys %{$$path_tr{$j};} != 1)
2065 137 159 if (@state_ind_path > 1)
2080 122 15 unless (exists $todo_ctrl{$state_ind_path[-1]})
2091 65 72 exists $$path{$first}{$last} ? :
2110 30 376 if ($accepting_state_inds{my $state_ind = $state_ind_path[$_]})
2113 0 30 exists $$path{$first}{$state_ind} ? :
2148 113 17 if (keys %accepting_state_inds == 1) { }
3 14 elsif (keys %accepting_state_inds == 2 and exists $accepting_state_inds{0}) { }
2194 130 130 $reversed ? :
2204 130 130 $reversed ? :
2208 508 269 if (not exists $$tmp_path{$branch} or $branch == 0 or $branch == $unique_accepting_state_ind or keys %{$$tmp_path_tr{$branch};} != 1)
2224 35 52 if (ref $$tmp_path{$parent}{$branch} ne 'cc' and $$tmp_path{$parent}{$branch}[0] || @{$$tmp_path{$parent}{$branch}[1];} > 1)
2239 257 97 $reversed ? :
54 125 $reversed ? :
354 179 exists $$tmp_path{$parent}{$child} ? :
2344 0 160 unless $weight{$a} <=> $weight{$b}
2353 138 1197 if ($i == $k and $k == $j)
2355 533 421 if (exists $$path{$i}{$j} and ($i != $k and $k != $j))
2361 763 226 $i != $k ? :
794 195 $k != $j ? :
989 208 exists $$path{$k}{$k} ? :
2378 157 1040 $i == $j ? :
2380 664 533 if (@trees == 1) { }
2412 52 78 if ($$nfa[0][0]) { }
2414 36 16 exists $$path{'0'}{0} ? :
2416 47 5 if ($unique_accepting_state_ind == 0) { }
2422 0 5 if ($path_0_0 == $cc_none and ref $path_0_end ne 'cc' and $$path_0_end[0]) { }
2476 953 245 if (not defined $tree or ref $tree eq 'cc' or @{$$tree[1];} == 0 or not $FULL_FACTORIZE_FIXES and @{$$tree[1];} == 1 || !grep({ref $_ ne 'cc';} map({@$_;} @{$$tree[1];}))) { }
2493 1 319 if (ref $tmp_tree eq 'cc' or $$tmp_tree[0] or @{$$tmp_tree[1];} > 1) { }
2511 1 1597 ref $_ ne 'cc' && !$$_[0] && @{$$_[1];} == 1 ? :
2516 4 241 if (@{$$tree[1];} == 1)
2526 241 241 $_ ? :
2529 415 117 if (grep {$$tree[1][0][$i] != $$_[$i] unless $i >= @$_ or ref $$_[$i] ne 'cc';} @{$$tree[1];}[1 .. $#{$$tree[1];}])
2530 499 214 unless $i >= @$_ or ref $$_[$i] ne 'cc'
2542 172 69 if ($pre_len == 0 and $suf_len == 0)
2551 104 53 if ($pre_len <= $#$_ - $suf_len) { }
53 0 elsif (not $empty_seen++) { }
2567 0 69 $empty_seen == @{$$tree[1];} ? :
2581 115 3 defined $_[0] ? :
2582 14 104 $_[1] ? :
2590 24 905 if (ref $tree eq 'cc') { }
0 905 elsif (@{$$tree[1];} == 0) { }
311 594 elsif (@{$$tree[1];} == 1 and @{$$tree[1][0];} == 1) { }
2604 311 0 if (ref $atom eq 'cc') { }
2605 307 4 $$tree[0] ? :
2624 2100 778 ref $_ eq 'cc' ? :
2639 187 346 $to_perlre ? :
533 61 $needs_parenthesis ? :
533 61 $needs_parenthesis ? :
195 399 $$tree[0] ? :
2652 95 189 if (ref $tree eq 'cc') { }
2672 840 2155 if (ref $tree_0 eq 'cc') { }
5 2150 elsif (@{$$tree_0[1];} == 0) { }
266 1884 elsif ($$tree_0[0]) { }
1472 412 elsif (@{$$tree_0[1];} == 1) { }
2673 5 835 if (@$tree_0 == 0) { }
321 514 elsif (ref $tree_1 eq 'cc') { }
1 513 elsif (@{$$tree_1[1];} == 0) { }
373 140 elsif ($$tree_1[0]) { }
2674 1 4 if (ref $tree_1 ne 'cc' and @{$$tree_1[1];} == 0) { }
2687 1 320 if (@$tree_1 == 0) { }
2705 42 98 if ($FULL_FACTORIZE_FIXES or grep {$$_[0] if ref $_ ne 'cc';} map({@$_;} @{$$tree_1[1];})) { }
2706 85 449 if ref $_ ne 'cc'
2725 1 4 if (ref $tree_1 ne 'cc' and @{$$tree_1[1];} == 0) { }
2738 90 176 if (ref $tree_1 eq 'cc') { }
1 175 elsif (@{$$tree_1[1];} == 0) { }
1 174 elsif ($$tree_1[0]) { }
100 74 elsif (@{$$tree_1[1];} == 1) { }
2739 1 89 if (@$tree_1 == 0) { }
2769 398 1074 if (ref $tree_1 eq 'cc') { }
1 1073 elsif (@{$$tree_1[1];} == 0) { }
416 657 elsif ($$tree_1[0]) { }
298 359 elsif (@{$$tree_1[1];} == 1) { }
15 344 elsif (not grep({ref $_ ne 'cc';} @{$$tree_0[1][0];})) { }
2770 1 397 if (@$tree_1 == 0) { }
2800 5 10 if ($FULL_FACTORIZE_FIXES or grep {$$_[0] if ref $_ ne 'cc';} map({@$_;} @{$$tree_1[1];})) { }
2801 10 204 if ref $_ ne 'cc'
2827 64 348 if (ref $tree_1 eq 'cc') { }
0 348 elsif (@{$$tree_1[1];} == 0) { }
267 81 elsif ($$tree_1[0]) { }
13 68 elsif (@{$$tree_1[1];} == 1) { }
0 68 elsif ($TREE_CONCAT_FULL_EXPAND) { }
2828 0 64 if (@$tree_1 == 0) { }
2833 12 52 if ($FULL_FACTORIZE_FIXES or grep {$$_[0] if ref $_ ne 'cc';} map({@$_;} @{$$tree_0[1];})) { }
2834 7 359 if ref $_ ne 'cc'
2863 11 2 if (not grep({ref $_ ne 'cc';} @{$$tree_1[1][0];})) { }
2864 2 9 if ($FULL_FACTORIZE_FIXES or grep {$$_[0] if ref $_ ne 'cc';} map({@$_;} @{$$tree_0[1];})) { }
2865 1 144 if ref $_ ne 'cc'
2914 0 1476 if (@_ == 0) { }
31 1445 elsif (@_ == 1) { }
0 1445 elsif (grep {not defined $_;} @_) { }
2928 1452 2704 if (ref $_ eq 'cc') { }
2932 30 2674 if (@word > 1) { }
438 2236 elsif (@word) { }
2943 151 1294 if (@word > 1) { }
351 943 elsif (@word) { }
2965 425 1547 if (ref $_ eq 'cc') { }
0 1547 elsif (not @{$$_[1];}) { }
265 1282 elsif ($$_[0]) { }
2979 874 133 if (not @starified_alts) { }
132 1 elsif (not @non_starified_alts) { }
2980 835 39 if (@non_starified_alts > 1 or $has_empty or @non_starified_alts and @{$non_starified_alts[0];} > 1) { }
0 39 elsif (not @non_starified_alts) { }
2986 0 835 $has_empty ? :
3020 0 131 unless (defined $_[0])
3024 48 83 if (ref $tree eq 'cc') { }
20 63 elsif (@{$$tree[1];} == 0) { }
3040 126 6 if (ref $atom eq 'cc') { }
3050 30 33 $$tree[0] ? :
3063 1475 264 if (ref $tree eq 'cc') { }
264 0 elsif (defined $tree) { }
3065 1506 185 $$_[0] == $$_[1] ? :
3114 15 21 if ($$input_constraints[$i] eq 'free text') { }
3118 9 12 if (@previous_undefs)
3120 2 7 if (@previous_undefs > 1)
3131 1 11 if (@previous_undefs)
3133 1 0 if (@previous_undefs > 1)
3153 20 11 if ($$input_constraints[$i] eq 'free text' or @{$$input_constraints[$i];} > 1) { }
11 0 elsif (@{$$input_constraints[$i];} == 1 and length $$input_constraints[$i][0]) { }
3157 6 14 if (@previous_singles)
3159 0 6 if (@previous_singles > 1)
3180 5 7 if (@previous_singles)
3182 0 5 if (@previous_singles > 1)
3196 0 12 unless (@$input_constraints)
3201 10 21 $$input_constraints[$_] eq 'free text' ? :
3224 0 38 if (not defined $tree) { }
3 35 elsif (ref $tree eq 'cc') { }
0 35 elsif (@{$$tree[1];} == 0) { }
6 29 elsif ($$tree[0]) { }
14 15 elsif (@{$$tree[1];} == 1) { }
3283 12 17 if ($beg < $i and length $expanded_words[0])
3294 23 6 if ($i < @{$$tree[1][0];})
3297 23 0 if (@$sub_input_constraints and $$sub_input_constraints[0] eq 'free text' || grep({length $_;} @{$$sub_input_constraints[0];}))
3314 6 9 if (grep {grep {@$_ and $$_[$#$_][1] == 1114111 unless ref $_ ne 'cc';} @$_;} @{$$tree[1];}) { }
3315 268 11 unless ref $_ ne 'cc'
3332 6 6 $_ ? :
3335 3 10 if (grep {$$tree[1][0][$i] != $$_[$i] unless $i >= @$_ or ref $$_[$i] ne 'cc';} @{$$tree[1];}[0 .. $#{$$tree[1];}])
3336 25 3 unless $i >= @$_ or ref $$_[$i] ne 'cc'
3348 2 4 if ($pre_len)
3360 6 0 if (my(@mid_alts) = map({[@$_[$pre_len .. $#$_ - $suf_len]];} @{$$tree[1];}))
3369 1 5 if ($suf_len)
3398 224 0 if (@$input_constraint == 1) { }
3424 0 28 if (@$cc == 0) { }
1 27 elsif ($$cc[$#$cc][1] == 1114111) { }
3506 0 213 if ((pos $ere || 0) != length $ere)
3511 10 203 if (not $has_beg_anchor || $has_end_anchor) { }
3514 10 0 @alternation_nfas == 1 ? :
3530 6 197 if (not $has_beg_anchor or @alternation_nfas > 1)
3531 6 0 !$has_beg_anchor ? :
0 6 @alternation_nfas > 1 ? :
3537 2 201 if (not $has_end_anchor or @alternation_nfas > 1)
3538 0 2 @alternation_nfas > 1 ? :
2 0 !$has_end_anchor ? :
3545 203 0 @alternation_nfas == 1 ? :
3551 10 203 $$has_anchor_ref ? :
3563 119 118 @alternation_nfas == 1 ? :
3575 16 86 if ($$str_ref =~ /\G (.) - ([^]]) /cgmsx) { }
86 0 elsif ($$str_ref =~ /\G (.) /cgmsx) { }
3584 0 177 if ($$str_ref =~ /\G ([^]]) - ([^]]) /cgmsx) { }
75 102 elsif ($$str_ref =~ /\G ([^]]) /cgmsx) { }
3596 75 27 $neg ? :
3609 235 33 if ($$str_ref =~ /\G \* /cgmsx) { }
16 17 elsif ($$str_ref =~ /\G \+ /cgmsx) { }
8 9 elsif ($$str_ref =~ /\G \? /cgmsx) { }
9 0 elsif ($$str_ref =~ /\G \{ /cgmsx) { }
3620 9 0 if ($$str_ref =~ /\G ( [0-9]+ ) /cgmsx) { }
3622 8 1 if ($$str_ref =~ /\G , ([0-9]*) /cgmsx) { }
3624 0 8 if (length $max and $min > $max)
3636 0 9 unless ($$str_ref =~ /\G \} /cgmsx)
3670 435 1187 if ($$str_ref =~ /\G ( $ERE_literal + ) /cgmosx) { }
51 1136 elsif ($$str_ref =~ /\G ( \. + ) /cgmsx) { }
102 1034 elsif ($$str_ref =~ /\G ( \[ ) /cgmsx) { }
17 1017 elsif ($$str_ref =~ /\G \\ (.) /cgmsx) { }
9 1008 elsif ($$str_ref =~ /\G \^ /cgmsx) { }
9 999 elsif ($$str_ref =~ /\G \$ /cgmsx) { }
3699 0 102 unless ($$str_ref =~ /\G ] /cgmsx)
3734 497 502 if (@$nfa)
3735 173 324 if ($$str_ref =~ /\G (?= [*+?{] ) /cgmsx) { }
3737 82 91 if (@$nfa > 1)
3751 237 762 if ($$str_ref =~ /\G \( /cgmsx)
3753 0 237 unless ($$str_ref =~ /\G \) /cgmsx)
3756 95 142 if ($$str_ref =~ /\G (?= [*+?{] ) /cgmsx)
3774 208 389 if (@all_nfas > 1) { }
308 81 elsif (@all_nfas) { }
3795 23 32 if $$_[0]