Branch Coverage

blib/lib/Regexp/ERE.pm
Criterion Covered Total %
branch 508 606 83.8


line true false branch
326 2028 1 if ($$interval[1] < $sorted[$i][1])
340 81 970 unless (@$char_class)
343 932 38 if ($$char_class[0][0] != 0)
351 932 38 if ($$char_class[$i][1] != 1114111)
384 213 139 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])
411 55 158 $$char_class_0[$i_0][0] > $$char_class_1[$i_1][0] ? :
418 140 73 if ($$char_class_0[$i_0][1] <= $$char_class_1[$i_1][1])
423 157 56 if ($$char_class_1[$i_1][1] <= $$char_class_0[$i_0][1])
428 140 73 if ($interval_0_done)
429 157 56 if ($interval_1_done)
441 34606 63426 if ($c < $$interval[0]) { }
19484 43942 elsif ($c <= $$interval[1]) { }
465 29 57 unless (cc_match($char_class_1, $c))
477 0 554 if (@$char_class and $$char_class[0][0] < 0)
478 0 0 if ($$char_class[0][0] == -2) { }
479 0 0 if ($$char_class[0][1] == -1) { }
487 0 0 if ($$char_class[0][1] == -2) { }
496 514 40 if (@$char_class)
497 500 14 if (@$char_class == 1 and $$char_class[0][0] == $$char_class[0][1]) { }
4 10 elsif (@$char_class == 1 and $$char_class[0][0] == 0 and $$char_class[0][1] == 1114111) { }
6 4 elsif ($$char_class[$#$char_class][1] == 1114111) { }
502 41 459 if ($to_perlre) { }
506 458 1 $c =~ /$ERE_litteral/o ? :
521 1 5 if ($to_perlre) { }
533 1 3 if ($to_perlre) { }
543 40 514 if (@items == 0) { }
514 0 elsif (@items == 1) { }
550 0 0 if ($to_perlre) { }
565 5 5 if ($$_[0] == $$_[1]) { }
566 0 5 if ($$_[0] == 45) { }
0 5 elsif ($$_[0] == 93) { }
579 0 5 if ($$_[0] == 45 or $$_[0] == 93) { }
583 0 0 if ($$_[0] == 45) { }
589 0 0 if ($$_[1] == $$_[0] + 1) { }
0 0 elsif ($$_[1] == $$_[0] + 2) { }
600 4 1 if ($$_[1] == $$_[0] + 1) { }
611 0 8 if ($has_minus)
612 0 8 if ($has_r_bracket)
620 1 1 if ($$_[0] == $$_[1]) { }
622 0 1 $c =~ /$PERLRE_char_class_special/o ? :
626 0 1 $c1 =~ /$PERLRE_char_class_special/o ? :
0 1 $$_[0] + 1 < $$_[1] ? :
0 1 $c2 =~ /$PERLRE_char_class_special/o ? :
690 194 511 $state_ind_map && exists $$state_ind_map{$$_[1]} ? :
700 136 48 $state_ind_map && exists $$state_ind_map{$$t_0[1]} ? :
705 158 26 unless (exists $state_ind_to_t_1{$state_ind_0})
707 16 10 unless (cc_is_subset($$t_0[0], $$t_1[0]))
735 868 4920 if (exists $$state_ind_to_equiv{$$_[1]}) { }
752 727 2372 if (keys %equiv_index_to_char_classes)
758 87 492 exists $equiv_index_to_char_classes{$_} ? :
768 728 11 @{$equiv_index_to_char_classes{$_};} == 1 ? :
803 13 232 if ($min > 0)
808 244 1 if (length $max == 0 or $max > $min)
812 7 237 if ($$nfa[0][0]) { }
234 3 elsif (not grep({$$_[1] == 0;} map({@{$$_[1];};} @$nfa))) { }
845 232 13 if (length $max == 0) { }
12 1 elsif ($max > $min) { }
857 228 4 if (_transitions_is_subset($$optional_part[$_][1], $$optional_part[0][1], {$_, 0})) { }
870 2 2 if (grep {exists $root_index_to_char_class{$_};} map({$$_[1];} @{$$optional_part[$_][1];})) { }
890 2 2 @{$new_index_to_char_classes{$_};} == 1 ? :
905 228 4 keys %$state_ind_to_equiv ? :
919 233 12 @quant_parts == 1 ? :
940 0 257 unless (@_)
967 177 636 if ($$_[1] += $init_state_ind) == $init_state_ind
973 202 215 if (@{$$state[1];} <= 1 and _transitions_is_subset($$state[1], $$nfa[0][1], {$acc_ind, $init_state_ind})) { }
14 201 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];})))) { }
1075 137 209 if (not $init_reachable || $init_equiv_reachable or $init_skipped == @accepting_state_inds)
1083 168 178 if (not $$nfa[0][0]) { }
5 173 elsif ($starifying) { }
1093 5 0 unless ($init_reachable)
1109 211 46 if (keys %$state_ind_to_equiv) { }
1142 31 262 if (@$nfa == 1 and @{$$nfa[0][1];} == 0)
1157 214 892 if ($$orig_state[0] and not @{$$orig_state[1];}) { }
1161 115 99 if (defined $first_trivial_accepting_state_ind) { }
1172 27 1097 if ($$_[1] += $init_state_ind) == $init_state_ind
1181 237 25 unless ($init_reachable)
1186 116 9 if (keys %$state_ind_to_equiv) { }
1255 1942 2218 if (($char_class = ($cached_cc_inter2{$$t_0[0]}{$$t_1[0]} ||= &cc_inter2($$t_0[0], $$t_1[0]))) != $cc_none)
1266 813 1129 unless (exists $todo_seen{$to_state_ind})
1274 19 812 if ($accepting = $nfa_0_accepting && $nfa_1_accepting)
1293 0 18 if (keys %livings == 0)
1331 2 0 unless (exists $begs{$_})
1345 10 27 if ($$nfa[$from_state_ind][0])
1357 0 0 unless (exists $livings{$_})
1365 1 9 scalar grep({$$nfa[$_][0];} keys %begs) ? :
9 1 unless ($accept_empty = scalar grep({$$nfa[$_][0];} keys %begs) ? 1 : 0)
1375 14 0 unless (exists $begs{$_} or exists $begends{$_})
1376 3 11 if ($$nfa[$_][0])
1399 10 20 if ($$_[0][0][0] >= 0) { }
20 0 elsif (@{$$_[0];} == 1) { }
1418 8 2 if (@{$$nfa[0][1];}) { }
1434 8 0 if ($clone_reachable)
1444 0 8 if ($$nfa[0][0])
1460 2 8 if (keys %begs > 1)
1473 4 6 if ($$nfa[0][0] = $accept_empty)
1486 13 11 unless (exists $reachables{$_})
1500 5 3 unless (exists $livings{$_})
1507 4 6 if (keys %livings == 0) { }
0 6 elsif (keys %livings == @$nfa) { }
1561 0 0 $$nfa[$i][0] ? :
1596 0 470 if ($$state1[0] != $$state2[0])
1603 0 470 if (@$transitions1 != @$transitions2)
1609 0 1393 if ($cc1 ne $cc2)
1612 1012 381 if (exists $nfa1_nfa2_indexes{$next_index1}) { }
0 381 elsif (exists $nfa2_nfa1_indexes{$next_index2}) { }
1613 0 1012 if ($nfa1_nfa2_indexes{$next_index1} != $next_index2)
1663 0 21002 unless $$a[0] <=> $$b[0]
1709 343 3061 if ($j < @sorted and $sorted[$j][0] <= $sorted[$i][1])
1720 0 343 if ($sorted[$i][1] != $sorted[$j][1])
1750 0 178 unless (@$nfa)
1763 245 792 scalar grep({$$_[0];} @nfa_states) ? :
1782 859 2161 unless (exists $dfa_indexes{$next_index_key})
1800 990 47 if ((my $all_cc = cc_union(@any_ccs)) != $cc_any)
1808 168 10 if ($trap_needed)
1843 245 960 if ($$dfa[$index][0]) { }
1852 172 6 if (@non_acceptings) { }
1863 67449 729402 if exists $indexes{$$_[1]}
1875 15626 213980 if (exists $prev_inds{$_}) { }
1882 105301 592 if (not @inter && @diff) { }
1888 0 592 if ($todo{$prev_inds_key}) { }
147 445 elsif (@diff < @inter) { }
1969 127 478 if ($$nfa[$i][0])
1992 190 415 unless (exists $$path{$first})
1997 591 191 if (keys %{$$path_tr{$i};} != 1 or $i == $first)
2013 53 127 if (keys %{$$path_tr{$j};} != 1)
2022 61 130 if (@state_ind_path > 1)
2037 40 21 unless (exists $todo_ctrl{$state_ind_path[-1]})
2048 39 22 exists $$path{$first}{$last} ? :
2067 30 150 if ($accepting_state_inds{my $state_ind = $state_ind_path[$_]})
2070 0 30 exists $$path{$first}{$state_ind} ? :
2105 92 15 if (keys %accepting_state_inds == 1) { }
3 12 elsif (keys %accepting_state_inds == 2 and exists $accepting_state_inds{0}) { }
2151 107 107 $reversed ? :
2161 107 107 $reversed ? :
2165 362 250 if (not exists $$tmp_path{$branch} or $branch == 0 or $branch == $unique_accepting_state_ind or keys %{$$tmp_path_tr{$branch};} != 1)
2181 37 48 if (ref $$tmp_path{$parent}{$branch} ne 'cc' and $$tmp_path{$parent}{$branch}[0] || @{$$tmp_path{$parent}{$branch}[1];} > 1)
2196 224 97 $reversed ? :
30 127 $reversed ? :
321 157 exists $$tmp_path{$parent}{$child} ? :
2289 0 45 unless exists $$path{$b}{$b} <=> exists $$path{$a}{$a}
2303 93 911 if ($i == $k and $k == $j)
2305 412 282 if (exists $$path{$i}{$j} and ($i != $k and $k != $j))
2311 594 148 $i != $k ? :
608 134 $k != $j ? :
742 169 exists $$path{$k}{$k} ? :
2328 96 815 $i == $j ? :
2330 499 412 if (@trees == 1) { }
2362 43 64 if ($$nfa[0][0]) { }
2364 27 16 exists $$path{'0'}{0} ? :
2366 38 5 if ($unique_accepting_state_ind == 0) { }
2372 0 5 if ($path_0_0 == $cc_none and ref $path_0_end ne 'cc' and $$path_0_end[0]) { }
2426 575 115 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];}))) { }
2444 1 160 if (ref $tmp_tree eq 'cc' or $$tmp_tree[0] or @{$$tmp_tree[1];} > 1) { }
2462 115 115 $_ ? :
2465 185 77 if (grep {$$tree[1][0][$i] != $$_[$i] unless $i >= @$_ or ref $$_[$i] ne 'cc';} @{$$tree[1];}[0 .. $#{$$tree[1];}])
2466 464 189 unless $i >= @$_ or ref $$_[$i] ne 'cc'
2478 60 55 if ($pre_len == 0 and $suf_len == 0)
2487 89 31 if ($pre_len <= $#$_ - $suf_len) { }
31 0 elsif (not $empty_seen++) { }
2503 2 53 $empty_seen == @{$$tree[1];} ? :
2517 99 3 defined $_[0] ? :
2518 5 97 $_[1] ? :
2526 21 636 if (ref $tree eq 'cc') { }
0 636 elsif (@{$$tree[1];} == 0) { }
185 451 elsif (@{$$tree[1];} == 1 and @{$$tree[1][0];} == 1) { }
2540 185 0 if (ref $atom eq 'cc') { }
2541 181 4 $$tree[0] ? :
2557 1404 543 ref $_ eq 'cc' ? :
2572 24 368 $to_perlre ? :
392 59 $needs_parenthesis ? :
392 59 $needs_parenthesis ? :
143 308 $$tree[0] ? :
2585 55 118 if (ref $tree eq 'cc') { }
2605 565 1649 if (ref $tree_0 eq 'cc') { }
5 1644 elsif (@{$$tree_0[1];} == 0) { }
169 1475 elsif ($$tree_0[0]) { }
1106 369 elsif (@{$$tree_0[1];} == 1) { }
2606 5 560 if (@$tree_0 == 0) { }
285 275 elsif (ref $tree_1 eq 'cc') { }
1 274 elsif (@{$$tree_1[1];} == 0) { }
194 80 elsif ($$tree_1[0]) { }
2607 1 4 if (ref $tree_1 ne 'cc' and @{$$tree_1[1];} == 0) { }
2620 1 284 if (@$tree_1 == 0) { }
2638 11 69 if ($FULL_FACTORIZE_FIXES or grep {$$_[0] if ref $_ ne 'cc';} map({@$_;} @{$$tree_1[1];})) { }
2639 13 234 if ref $_ ne 'cc'
2658 1 4 if (ref $tree_1 ne 'cc' and @{$$tree_1[1];} == 0) { }
2671 47 122 if (ref $tree_1 eq 'cc') { }
1 121 elsif (@{$$tree_1[1];} == 0) { }
1 120 elsif ($$tree_1[0]) { }
66 54 elsif (@{$$tree_1[1];} == 1) { }
2672 1 46 if (@$tree_1 == 0) { }
2702 247 859 if (ref $tree_1 eq 'cc') { }
1 858 elsif (@{$$tree_1[1];} == 0) { }
294 564 elsif ($$tree_1[0]) { }
231 333 elsif (@{$$tree_1[1];} == 1) { }
6 327 elsif (not grep({ref $_ ne 'cc';} @{$$tree_0[1][0];})) { }
2703 1 246 if (@$tree_1 == 0) { }
2733 0 6 if ($FULL_FACTORIZE_FIXES or grep {$$_[0] if ref $_ ne 'cc';} map({@$_;} @{$$tree_1[1];})) { }
2734 0 18 if ref $_ ne 'cc'
2760 39 330 if (ref $tree_1 eq 'cc') { }
0 330 elsif (@{$$tree_1[1];} == 0) { }
250 80 elsif ($$tree_1[0]) { }
8 72 elsif (@{$$tree_1[1];} == 1) { }
0 72 elsif ($TREE_CONCAT_FULL_EXPAND) { }
2761 0 39 if (@$tree_1 == 0) { }
2766 6 33 if ($FULL_FACTORIZE_FIXES or grep {$$_[0] if ref $_ ne 'cc';} map({@$_;} @{$$tree_0[1];})) { }
2767 5 221 if ref $_ ne 'cc'
2796 7 1 if (not grep({ref $_ ne 'cc';} @{$$tree_1[1][0];})) { }
2797 6 1 if ($FULL_FACTORIZE_FIXES or grep {$$_[0] if ref $_ ne 'cc';} map({@$_;} @{$$tree_0[1];})) { }
2798 6 12 if ref $_ ne 'cc'
2847 0 994 if (@_ == 0) { }
31 963 elsif (@_ == 1) { }
0 963 elsif (grep {not defined $_;} @_) { }
2861 752 2015 if (ref $_ eq 'cc') { }
2865 33 1982 if (@word > 1) { }
220 1762 elsif (@word) { }
2876 91 872 if (@word > 1) { }
146 726 elsif (@word) { }
2898 348 1256 if (ref $_ eq 'cc') { }
0 1256 elsif (not @{$$_[1];}) { }
143 1113 elsif ($$_[0]) { }
2912 747 72 if (not @starified_alts) { }
71 1 elsif (not @non_starified_alts) { }
2913 712 35 if (@non_starified_alts > 1 or $has_empty or @non_starified_alts and @{$non_starified_alts[0];} > 1) { }
0 35 elsif (not @non_starified_alts) { }
2919 0 712 $has_empty ? :
2953 0 131 unless (defined $_[0])
2957 48 83 if (ref $tree eq 'cc') { }
20 63 elsif (@{$$tree[1];} == 0) { }
2973 126 6 if (ref $atom eq 'cc') { }
2983 30 33 $$tree[0] ? :
3030 4 11 if ($$input_constraints[$i] eq 'free text') { }
3034 4 7 if (@previous_undefs)
3036 0 4 if (@previous_undefs > 1)
3047 0 5 if (@previous_undefs)
3049 0 0 if (@previous_undefs > 1)
3069 10 5 if ($$input_constraints[$i] eq 'free text' or @{$$input_constraints[$i];} > 1) { }
5 0 elsif (@{$$input_constraints[$i];} == 1 and length $$input_constraints[$i][0]) { }
3073 3 7 if (@previous_singles)
3075 0 3 if (@previous_singles > 1)
3096 2 3 if (@previous_singles)
3098 0 2 if (@previous_singles > 1)
3112 0 5 unless (@$input_constraints)
3117 4 11 $$input_constraints[$_] eq 'free text' ? :
3140 0 14 if (not defined $tree) { }
0 14 elsif (ref $tree eq 'cc') { }
0 14 elsif (@{$$tree[1];} == 0) { }
2 12 elsif ($$tree[0]) { }
5 7 elsif (@{$$tree[1];} == 1) { }
3199 6 6 if ($beg < $i and length $expanded_words[0])
3210 9 3 if ($i < @{$$tree[1][0];})
3213 9 0 if (@$sub_input_constraints and $$sub_input_constraints[0] eq 'free text' || length $$sub_input_constraints[0][0])
3230 2 5 if (grep {grep {@$_ and $$_[$#$_][1] == 1114111 unless ref $_ ne 'cc';} @$_;} @{$$tree[1];}) { }
3231 104 3 unless ref $_ ne 'cc'
3248 2 2 $_ ? :
3251 2 0 if (grep {$$tree[1][0][$i] != $$_[$i] unless $i >= @$_ or ref $$_[$i] ne 'cc';} @{$$tree[1];}[0 .. $#{$$tree[1];}])
3252 4 2 unless $i >= @$_ or ref $$_[$i] ne 'cc'
3264 0 2 if ($pre_len)
3276 2 0 if (my(@mid_alts) = map({[@$_[$pre_len .. $#$_ - $suf_len]];} @{$$tree[1];}))
3285 0 2 if ($suf_len)
3314 85 0 if (@$input_constraint == 1) { }
3340 0 26 if (@$cc == 0) { }
0 26 elsif ($$cc[$#$cc][1] == 1114111) { }
3422 0 187 if ((pos $ere || 0) != length $ere)
3427 10 177 if (not $has_beg_anchor || $has_end_anchor) { }
3430 10 0 @alternation_nfas == 1 ? :
3446 6 171 if (not $has_beg_anchor or @alternation_nfas > 1)
3447 6 0 !$has_beg_anchor ? :
0 6 @alternation_nfas > 1 ? :
3453 2 175 if (not $has_end_anchor or @alternation_nfas > 1)
3454 0 2 @alternation_nfas > 1 ? :
2 0 !$has_end_anchor ? :
3461 177 0 @alternation_nfas == 1 ? :
3467 10 177 $$has_anchor_ref ? :
3479 98 120 @alternation_nfas == 1 ? :
3491 12 70 if ($$str_ref =~ /\G (.) - ([^]]) /cgmsx) { }
70 0 elsif ($$str_ref =~ /\G (.) /cgmsx) { }
3500 0 148 if ($$str_ref =~ /\G ([^]]) - ([^]]) /cgmsx) { }
66 82 elsif ($$str_ref =~ /\G ([^]]) /cgmsx) { }
3512 55 27 $neg ? :
3525 223 22 if ($$str_ref =~ /\G \* /cgmsx) { }
7 15 elsif ($$str_ref =~ /\G \+ /cgmsx) { }
8 7 elsif ($$str_ref =~ /\G \? /cgmsx) { }
7 0 elsif ($$str_ref =~ /\G \{ /cgmsx) { }
3536 7 0 if ($$str_ref =~ /\G ( [0-9]+ ) /cgmsx) { }
3538 6 1 if ($$str_ref =~ /\G , ([0-9]*) /cgmsx) { }
3540 0 6 if (length $max and $min > $max)
3552 0 7 unless ($$str_ref =~ /\G \} /cgmsx)
3573 440 1067 if ($$str_ref =~ /\G ( $ERE_litteral + ) /cgmosx) { }
31 1036 elsif ($$str_ref =~ /\G ( \. + ) /cgmsx) { }
82 954 elsif ($$str_ref =~ /\G ( \[ ) /cgmsx) { }
7 947 elsif ($$str_ref =~ /\G \\ (.) /cgmsx) { }
9 938 elsif ($$str_ref =~ /\G \^ /cgmsx) { }
9 929 elsif ($$str_ref =~ /\G \$ /cgmsx) { }
3602 0 82 unless ($$str_ref =~ /\G ] /cgmsx)
3637 488 441 if (@$nfa)
3638 161 327 if ($$str_ref =~ /\G (?= [*+?{] ) /cgmsx) { }
3641 81 80 if (@$nfa > 1)
3657 218 711 if ($$str_ref =~ /\G \( /cgmsx)
3659 0 218 unless ($$str_ref =~ /\G \) /cgmsx)
3662 84 134 if ($$str_ref =~ /\G (?= [*+?{] ) /cgmsx) { }
3672 177 381 if (@all_nfas > 1) { }
326 55 elsif (@all_nfas) { }