Branch Coverage

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


line true false branch
327 3064 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 46706 91813 if ($c < $$interval[0]) { }
27591 64222 elsif ($c <= $$interval[1]) { }
466 32 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 206 315 $state_ind_map && exists $$state_ind_map{$$_[1]} ? :
701 148 64 $state_ind_map && exists $$state_ind_map{$$t_0[1]} ? :
706 185 27 unless (exists $state_ind_to_t_1{$state_ind_0})
708 17 10 unless (cc_is_subset($$t_0[0], $$t_1[0]))
736 1018 6077 if (exists $$state_ind_to_equiv{$$_[1]}) { }
753 804 3123 if (keys %equiv_index_to_char_classes)
759 115 526 exists $equiv_index_to_char_classes{$_} ? :
769 795 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)) ? :
247 24 $min == 0 ? :
830 13 258 if ($min_left > 0)
833 270 1 if (length $max == 0 or $max > $min)
834 7 263 if ($$nfa[0][0]) { }
251 12 elsif (not grep({$$_[1] == 0;} map({@{$$_[1];};} @$nfa))) { }
864 256 15 if (length $max == 0) { }
14 1 elsif ($max > $min) { }
876 251 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 251 5 keys %$state_ind_to_equiv ? :
937 13 258 if ($min_right > 0)
940 248 23 @quant_parts == 1 ? :
961 0 316 unless (@_)
989 176 887 if ($$_[1] += $init_state_ind) == $init_state_ind
996 244 266 if (@{$$state[1];} == 0 or @{$$state[1];} == 1 and _transitions_is_subset($$state[1], $$nfa[0][1], {$acc_ind, $init_state_ind})) { }
14 252 elsif ($init_reachable == 1 and 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];})))) { }
1100 146 255 if (not $init_reachable || $init_equiv_reachable or $init_skipped == @accepting_state_inds)
1108 205 196 if (not $$nfa[0][0]) { }
13 183 elsif ($starifying) { }
1118 13 0 unless ($init_reachable)
1134 257 59 if (keys %$state_ind_to_equiv) { }
1167 57 243 if (@$nfa == 1 and @{$$nfa[0][1];} == 0)
1182 164 1097 if ($$orig_state[0] and not @{$$orig_state[1];}) { }
1186 87 77 if (defined $first_trivial_accepting_state_ind) { }
1197 31 1280 if ($$_[1] += $init_state_ind) == $init_state_ind
1206 214 29 unless ($init_reachable)
1211 120 10 if (keys %$state_ind_to_equiv) { }
1280 2936 2868 if (($char_class = ($cached_cc_inter2{$$t_0[0]}{$$t_1[0]} ||= &cc_inter2($$t_0[0], $$t_1[0]))) != $cc_none)
1291 1403 1533 unless (exists $todo_seen{$to_state_ind})
1299 26 1402 if ($accepting = $nfa_0_accepting && $nfa_1_accepting)
1318 0 25 if (keys %livings == 0)
1356 3 0 unless (exists $begs{$_})
1370 10 28 if ($$nfa[$from_state_ind][0])
1382 0 0 unless (exists $livings{$_})
1390 1 9 scalar grep({$$nfa[$_][0];} keys %begs) ? :
9 1 unless ($accept_empty = scalar grep({$$nfa[$_][0];} keys %begs) ? 1 : 0)
1400 14 0 unless (exists $begs{$_} or exists $begends{$_})
1401 3 11 if ($$nfa[$_][0])
1424 9 22 if ($$_[0][0][0] >= 0) { }
22 0 elsif (@{$$_[0];} == 1) { }
1443 8 2 if (@{$$nfa[0][1];}) { }
1459 8 0 if ($clone_reachable)
1469 0 8 if ($$nfa[0][0])
1485 2 8 if (keys %begs > 1)
1498 4 6 if ($$nfa[0][0] = $accept_empty)
1511 14 11 unless (exists $reachables{$_})
1525 5 3 unless (exists $livings{$_})
1532 4 6 if (keys %livings == 0) { }
0 6 elsif (keys %livings == @$nfa) { }
1586 0 0 $$nfa[$i][0] ? :
1621 0 583 if ($$state1[0] != $$state2[0])
1628 0 583 if (@$transitions1 != @$transitions2)
1634 0 1662 if ($cc1 ne $cc2)
1637 1178 484 if (exists $nfa1_nfa2_indexes{$next_index1}) { }
0 484 elsif (exists $nfa2_nfa1_indexes{$next_index2}) { }
1638 0 1178 if ($nfa1_nfa2_indexes{$next_index1} != $next_index2)
1688 0 30221 unless $$a[0] <=> $$b[0]
1734 446 4311 if ($j < @sorted and $sorted[$j][0] <= $sorted[$i][1])
1745 0 446 if ($sorted[$i][1] != $sorted[$j][1])
1775 0 207 unless (@$nfa)
1788 275 1051 scalar grep({$$_[0];} @nfa_states) ? :
1807 1119 3216 unless (exists $dfa_indexes{$next_index_key})
1825 1177 149 if ((my $all_cc = cc_union(@any_ccs)) != $cc_any)
1833 195 12 if ($trap_needed)
1868 275 1246 if ($$dfa[$index][0]) { }
1877 199 8 if (@non_acceptings) { }
1888 89070 825213 if exists $indexes{$$_[1]}
1900 21234 247842 if (exists $prev_inds{$_}) { }
1907 126881 795 if (not @inter && @diff) { }
1913 0 795 if ($todo{$prev_inds_key}) { }
174 621 elsif (@diff < @inter) { }
1994 153 770 if ($$nfa[$i][0])
2017 411 512 unless (exists $$path{$first})
2020 0 263 unless keys %{$$path_tr{$b};} <=> keys %{$$path_tr{$a};}
2036 165 296 if (keys %{$$path_tr{$i};} != 1)
2037 69 96 if ($i != $first and not $todo_sorted and @todo)
2040 0 35 unless keys %{$$path_tr{$b};} <=> keys %{$$path_tr{$a};}
2060 107 299 if (keys %{$$path_tr{$j};} != 1)
2069 137 159 if (@state_ind_path > 1)
2084 122 15 unless (exists $todo_ctrl{$state_ind_path[-1]})
2095 65 72 exists $$path{$first}{$last} ? :
2114 30 376 if ($accepting_state_inds{my $state_ind = $state_ind_path[$_]})
2117 0 30 exists $$path{$first}{$state_ind} ? :
2152 114 17 if (keys %accepting_state_inds == 1) { }
3 14 elsif (keys %accepting_state_inds == 2 and exists $accepting_state_inds{0}) { }
2198 131 131 $reversed ? :
2208 131 131 $reversed ? :
2212 508 269 if (not exists $$tmp_path{$branch} or $branch == 0 or $branch == $unique_accepting_state_ind or keys %{$$tmp_path_tr{$branch};} != 1)
2228 35 52 if (ref $$tmp_path{$parent}{$branch} ne 'cc' and $$tmp_path{$parent}{$branch}[0] || @{$$tmp_path{$parent}{$branch}[1];} > 1)
2243 257 97 $reversed ? :
54 125 $reversed ? :
354 179 exists $$tmp_path{$parent}{$child} ? :
2348 0 168 unless $weight{$a} <=> $weight{$b}
2357 139 1197 if ($i == $k and $k == $j)
2359 533 421 if (exists $$path{$i}{$j} and ($i != $k and $k != $j))
2365 763 226 $i != $k ? :
794 195 $k != $j ? :
989 208 exists $$path{$k}{$k} ? :
2382 157 1040 $i == $j ? :
2384 664 533 if (@trees == 1) { }
2416 53 78 if ($$nfa[0][0]) { }
2418 37 16 exists $$path{'0'}{0} ? :
2420 48 5 if ($unique_accepting_state_ind == 0) { }
2426 0 5 if ($path_0_0 == $cc_none and ref $path_0_end ne 'cc' and $$path_0_end[0]) { }
2480 954 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];}))) { }
2497 1 319 if (ref $tmp_tree eq 'cc' or $$tmp_tree[0] or @{$$tmp_tree[1];} > 1) { }
2515 1 1597 ref $_ ne 'cc' && !$$_[0] && @{$$_[1];} == 1 ? :
2520 4 241 if (@{$$tree[1];} == 1)
2530 241 241 $_ ? :
2533 415 117 if (grep {$$tree[1][0][$i] != $$_[$i] unless $i >= @$_ or ref $$_[$i] ne 'cc';} @{$$tree[1];}[1 .. $#{$$tree[1];}])
2534 499 214 unless $i >= @$_ or ref $$_[$i] ne 'cc'
2546 172 69 if ($pre_len == 0 and $suf_len == 0)
2555 104 53 if ($pre_len <= $#$_ - $suf_len) { }
53 0 elsif (not $empty_seen++) { }
2571 0 69 $empty_seen == @{$$tree[1];} ? :
2585 116 3 defined $_[0] ? :
2586 14 105 $_[1] ? :
2594 24 906 if (ref $tree eq 'cc') { }
0 906 elsif (@{$$tree[1];} == 0) { }
312 594 elsif (@{$$tree[1];} == 1 and @{$$tree[1][0];} == 1) { }
2608 312 0 if (ref $atom eq 'cc') { }
2609 308 4 $$tree[0] ? :
2628 2100 778 ref $_ eq 'cc' ? :
2643 187 346 $to_perlre ? :
533 61 $needs_parenthesis ? :
533 61 $needs_parenthesis ? :
195 399 $$tree[0] ? :
2656 96 189 if (ref $tree eq 'cc') { }
2676 840 2155 if (ref $tree_0 eq 'cc') { }
5 2150 elsif (@{$$tree_0[1];} == 0) { }
266 1884 elsif ($$tree_0[0]) { }
1473 411 elsif (@{$$tree_0[1];} == 1) { }
2677 5 835 if (@$tree_0 == 0) { }
326 509 elsif (ref $tree_1 eq 'cc') { }
1 508 elsif (@{$$tree_1[1];} == 0) { }
373 135 elsif ($$tree_1[0]) { }
2678 1 4 if (ref $tree_1 ne 'cc' and @{$$tree_1[1];} == 0) { }
2691 1 325 if (@$tree_1 == 0) { }
2709 42 93 if ($FULL_FACTORIZE_FIXES or grep {$$_[0] if ref $_ ne 'cc';} map({@$_;} @{$$tree_1[1];})) { }
2710 85 434 if ref $_ ne 'cc'
2729 1 4 if (ref $tree_1 ne 'cc' and @{$$tree_1[1];} == 0) { }
2742 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) { }
2743 1 89 if (@$tree_1 == 0) { }
2773 398 1075 if (ref $tree_1 eq 'cc') { }
1 1074 elsif (@{$$tree_1[1];} == 0) { }
416 658 elsif ($$tree_1[0]) { }
298 360 elsif (@{$$tree_1[1];} == 1) { }
16 344 elsif (not grep({ref $_ ne 'cc';} @{$$tree_0[1][0];})) { }
2774 1 397 if (@$tree_1 == 0) { }
2804 5 11 if ($FULL_FACTORIZE_FIXES or grep {$$_[0] if ref $_ ne 'cc';} map({@$_;} @{$$tree_1[1];})) { }
2805 10 207 if ref $_ ne 'cc'
2831 59 352 if (ref $tree_1 eq 'cc') { }
0 352 elsif (@{$$tree_1[1];} == 0) { }
267 85 elsif ($$tree_1[0]) { }
13 72 elsif (@{$$tree_1[1];} == 1) { }
0 72 elsif ($TREE_CONCAT_FULL_EXPAND) { }
2832 0 59 if (@$tree_1 == 0) { }
2837 12 47 if ($FULL_FACTORIZE_FIXES or grep {$$_[0] if ref $_ ne 'cc';} map({@$_;} @{$$tree_0[1];})) { }
2838 7 364 if ref $_ ne 'cc'
2867 11 2 if (not grep({ref $_ ne 'cc';} @{$$tree_1[1][0];})) { }
2868 2 9 if ($FULL_FACTORIZE_FIXES or grep {$$_[0] if ref $_ ne 'cc';} map({@$_;} @{$$tree_0[1];})) { }
2869 1 144 if ref $_ ne 'cc'
2918 0 1476 if (@_ == 0) { }
31 1445 elsif (@_ == 1) { }
0 1445 elsif (grep {not defined $_;} @_) { }
2932 1452 2704 if (ref $_ eq 'cc') { }
2936 30 2674 if (@word > 1) { }
438 2236 elsif (@word) { }
2947 151 1294 if (@word > 1) { }
351 943 elsif (@word) { }
2969 425 1547 if (ref $_ eq 'cc') { }
0 1547 elsif (not @{$$_[1];}) { }
265 1282 elsif ($$_[0]) { }
2983 874 133 if (not @starified_alts) { }
132 1 elsif (not @non_starified_alts) { }
2984 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) { }
2990 0 835 $has_empty ? :
3024 0 131 unless (defined $_[0])
3028 48 83 if (ref $tree eq 'cc') { }
20 63 elsif (@{$$tree[1];} == 0) { }
3044 126 6 if (ref $atom eq 'cc') { }
3054 30 33 $$tree[0] ? :
3067 1476 265 if (ref $tree eq 'cc') { }
265 0 elsif (defined $tree) { }
3069 1506 186 $$_[0] == $$_[1] ? :
3118 15 21 if ($$input_constraints[$i] eq 'free text') { }
3122 9 12 if (@previous_undefs)
3124 2 7 if (@previous_undefs > 1)
3135 1 11 if (@previous_undefs)
3137 1 0 if (@previous_undefs > 1)
3157 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]) { }
3161 6 14 if (@previous_singles)
3163 0 6 if (@previous_singles > 1)
3184 5 7 if (@previous_singles)
3186 0 5 if (@previous_singles > 1)
3200 0 12 unless (@$input_constraints)
3205 10 21 $$input_constraints[$_] eq 'free text' ? :
3228 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) { }
3287 12 17 if ($beg < $i and length $expanded_words[0])
3298 23 6 if ($i < @{$$tree[1][0];})
3301 23 0 if (@$sub_input_constraints and $$sub_input_constraints[0] eq 'free text' || grep({length $_;} @{$$sub_input_constraints[0];}))
3318 6 9 if (grep {grep {@$_ and $$_[$#$_][1] == 1114111 unless ref $_ ne 'cc';} @$_;} @{$$tree[1];}) { }
3319 268 11 unless ref $_ ne 'cc'
3336 6 6 $_ ? :
3339 3 10 if (grep {$$tree[1][0][$i] != $$_[$i] unless $i >= @$_ or ref $$_[$i] ne 'cc';} @{$$tree[1];}[0 .. $#{$$tree[1];}])
3340 25 3 unless $i >= @$_ or ref $$_[$i] ne 'cc'
3352 2 4 if ($pre_len)
3364 6 0 if (my(@mid_alts) = map({[@$_[$pre_len .. $#$_ - $suf_len]];} @{$$tree[1];}))
3373 1 5 if ($suf_len)
3402 224 0 if (@$input_constraint == 1) { }
3428 0 28 if (@$cc == 0) { }
1 27 elsif ($$cc[$#$cc][1] == 1114111) { }
3510 0 215 if ((pos $ere || 0) != length $ere)
3515 10 205 if (not $has_beg_anchor || $has_end_anchor) { }
3518 10 0 @alternation_nfas == 1 ? :
3534 7 198 if (not $has_beg_anchor or @alternation_nfas > 1)
3535 7 0 !$has_beg_anchor ? :
0 7 @alternation_nfas > 1 ? :
3541 2 203 if (not $has_end_anchor or @alternation_nfas > 1)
3542 0 2 @alternation_nfas > 1 ? :
2 0 !$has_end_anchor ? :
3549 205 0 @alternation_nfas == 1 ? :
3555 10 205 $$has_anchor_ref ? :
3567 120 118 @alternation_nfas == 1 ? :
3579 16 86 if ($$str_ref =~ /\G (.) - ([^]]) /cgmsx) { }
86 0 elsif ($$str_ref =~ /\G (.) /cgmsx) { }
3588 0 177 if ($$str_ref =~ /\G ([^]]) - ([^]]) /cgmsx) { }
75 102 elsif ($$str_ref =~ /\G ([^]]) /cgmsx) { }
3600 75 27 $neg ? :
3613 238 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) { }
3624 9 0 if ($$str_ref =~ /\G ( [0-9]+ ) /cgmsx) { }
3626 8 1 if ($$str_ref =~ /\G , ([0-9]*) /cgmsx) { }
3628 0 8 if (length $max and $min > $max)
3640 0 9 unless ($$str_ref =~ /\G \} /cgmsx)
3674 437 1194 if ($$str_ref =~ /\G ( $ERE_literal + ) /cgmosx) { }
52 1142 elsif ($$str_ref =~ /\G ( \. + ) /cgmsx) { }
102 1040 elsif ($$str_ref =~ /\G ( \[ ) /cgmsx) { }
17 1023 elsif ($$str_ref =~ /\G \\ (.) /cgmsx) { }
9 1014 elsif ($$str_ref =~ /\G \^ /cgmsx) { }
9 1005 elsif ($$str_ref =~ /\G \$ /cgmsx) { }
3703 0 102 unless ($$str_ref =~ /\G ] /cgmsx)
3738 500 505 if (@$nfa)
3739 175 325 if ($$str_ref =~ /\G (?= [*+?{] ) /cgmsx) { }
3741 82 93 if (@$nfa > 1)
3755 238 767 if ($$str_ref =~ /\G \( /cgmsx)
3757 0 238 unless ($$str_ref =~ /\G \) /cgmsx)
3760 96 142 if ($$str_ref =~ /\G (?= [*+?{] ) /cgmsx)
3778 209 391 if (@all_nfas > 1) { }
310 81 elsif (@all_nfas) { }
3799 23 32 if $$_[0]