Branch Coverage

blib/lib/Regexp/Debugger.pm
Criterion Covered Total %
branch 19 672 2.8


line true false branch
14 0 1 if ($] < 5.010001)
94 0 0 if (not $lexical_config->{'save_to_fh'})
96 0 0 defined $_ ? :
101 0 0 if (not $lexical_config->{'save_to_fh'})
103 0 0 defined $_ ? :
122 0 1 if (not $can_color)
140 0 1 if (@_ % 2)
165 0 0 if (_module_is_active() and $type =~ /qq?/ and $is_interactive) { }
195 0 1 if (not $home_dir and eval { do { require File::HomeDir } })
201 1 0 $home_dir ? :
204 2 0 unless open my $fh, '<', $config_file
210 0 0 if ($config_line =~ /^\s*(.*?)\s*[:=]\s*(.*?)\s*$/)
223 0 8 if (exists $config{$colour})
230 0 1 if (defined $show_ws)
231 0 0 if ($show_ws ~~ \@SHOW_WS_OPTIONS) { }
244 0 0 $a =~ /(\d+)/ ? :
245 0 0 $b =~ /(\d+)/ ? :
246 0 0 defined $a_key && defined $b_key ? :
253 1 0 unless (@heatmap_cols)
262 1 0 if (defined $display)
264 0 0 $display =~ /^JSON/i ? :
1 0 $display =~ /^visual/i ? :
0 1 $display =~ /^heatmap/i ? :
0 1 $display =~ /^events/i ? :
273 0 1 if (defined $save_to)
275 0 0 if (&openhandle($save_to)) { }
0 0 elsif (not ref $save_to) { }
280 0 0 unless open my $fh, $mode || '>', $filename
313 0 0 if ($reversed)
316 0 0 if (ref $x)
317 0 0 if (ref $y)
320 0 0 if ($x =~ /^\\\(\\\?\\\#R_d\\:(\d+)\\\)/) { }
0 0 elsif ($x =~ /^\(\?\#R_D:(\d+)\)/) { }
0 0 elsif ($x =~ /^\(\?\#r_d:(\d+)\)/) { }
323 0 0 if ($y =~ /^\\\(\\\?\\\#R_d\\:(\d+)\\\)/) { }
0 0 elsif ($y =~ /^\(\?\#R_D:(\d+)\)/) { }
0 0 elsif ($y =~ /^\(\?\#r_d:(\d+)\)/) { }
362 0 0 $] <= 5.022 || $] >= 5.032 ? :
417 0 0 $start_line == $end_line ? :
472 0 0 !$Regexp::Debugger::in_quote ? :
476 0 0 $Regexp::Debugger::in_quote ? :
657 0 0 $^N == 1 ? :
660 0 0 $^N == 1 ? :
695 0 0 substr($+{'_charset'}, 0, 2) eq '[^' ? :
707 0 0 $^N == 1 ? :
775 0 0 exists $+{'whitespace_chars'} ? :
0 0 exists $+{'tab_char'} ? :
0 0 exists $+{'newline_char'} ? :
782 0 0 if (exists $+{'start'}) { }
0 0 elsif (exists $+{'end'}) { }
0 0 elsif (exists $+{'_alternation'}) { }
0 0 elsif (exists $+{'whitespace'}) { }
0 0 elsif (exists $+{'case_start'}) { }
0 0 elsif (exists $+{'case_end'}) { }
0 0 elsif (exists $+{'quote_start'}) { }
0 0 elsif (exists $+{'quote_end'}) { }
0 0 elsif (exists $+{'quote_space'}) { }
0 0 elsif (exists $+{'quote_nonspace'}) { }
0 0 elsif (exists $+{'atom'}) { }
0 0 elsif (exists $+{'code_block'}) { }
0 0 elsif (exists $+{'matchable_code_block'}) { }
0 0 elsif (exists $+{'keep_marker'}) { }
0 0 elsif (exists $+{'zero_width'}) { }
0 0 elsif (exists $+{'control'}) { }
0 0 elsif (exists $+{'define_block'}) { }
0 0 elsif (exists $+{'modifier_set'}) { }
0 0 elsif (exists $+{'conditional_paren'}) { }
0 0 elsif (exists $+{'branch_reset_paren'}) { }
0 0 elsif (exists $+{'noncapturing_paren'}) { }
0 0 elsif (exists $+{'non_backtracking_paren'}) { }
0 0 elsif (exists $+{'lookaround_paren'}) { }
0 0 elsif (exists $+{'capturing_paren'}) { }
0 0 elsif (exists $+{'named_capturing_paren'}) { }
0 0 elsif (exists $+{'closing_paren'}) { }
0 0 elsif (exists $+{'break_comment'}) { }
0 0 elsif (exists $+{'comment'}) { }
807 0 0 $steps != 1 ? :
811 0 0 if ($match_was_null and $prev_match_was_null) { }
828 0 0 $steps != 1 ? :
0 0 $steps ? :
839 0 0 if (my $reset = $paren_stack[-1]{'is_branch_reset'})
870 0 0 $_ eq ' ' ? :
0 0 $_ eq "\t" ? :
0 0 $_ eq "\n" ? :
992 0 0 $is_subpattern_call ? :
996 0 0 $is_subpattern_call ? :
1003 0 0 length $quantifier_desc ? :
0 0 length $quantifier_desc ? :
0 0 $is_subpattern_call ? :
1219 0 0 length $construct > 3 ? :
1270 0 0 if ($paren_stack[-2]{'is_conditional'} and $paren_stack[-2]{'is_pending'}) { }
1342 0 0 unless (@{$capture_names_for[$next_capture_group] // [];})
1377 0 0 if ($paren_data->{'is_branch_reset'})
1389 0 0 $paren_data->{'is_nonbacktrack'} ? :
0 0 $paren_data->{'is_conditional'} ? :
0 0 $paren_data->{'is_lookaround'} ? :
0 0 $paren_data->{'is_branch_reset'} ? :
0 0 $paren_data->{'is_definition'} ? :
0 0 $paren_data->{'is_capture'} ? :
0 0 $paren_data->{'is_capture'} && ref $paren_data->{'capture_name'} ? :
1393 0 0 if (length $std_info{'quantifier'})
1425 0 0 ref $msg ? :
0 0 $paren_data->{'is_nonbacktrack'} ? :
1491 0 0 @{$history_of{$data_mode} // [];} ? :
1503 0 0 if ($display_mode eq $data_mode)
1504 0 0 if (not $lexical_config->{'save_to_fh'} or $data_mode ne 'JSON')
1534 0 0 if $is_fail
1535 0 0 if $is_match
1549 0 0 if $step >= @{$history_of{$display_mode};}
1552 0 0 if ($input eq "\cC") { }
0 0 elsif ($input eq 'x') { }
0 0 elsif ($input eq "\f") { }
0 0 elsif ($input eq '-') { }
0 0 elsif ($input eq 'd') { }
0 0 elsif ($input eq '?') { }
0 0 elsif ($input eq 'v') { }
0 0 elsif ($input eq 'h') { }
0 0 elsif ($input eq 'e') { }
0 0 elsif ($input eq 'j') { }
0 0 elsif ($input eq 'q' or $input eq "\cD") { }
0 0 elsif ($input eq 'V') { }
0 0 elsif ($input eq 'H') { }
0 0 elsif ($input eq 'E') { }
0 0 elsif ($input eq 'J') { }
0 0 elsif ($input eq 'D') { }
0 0 elsif ($input eq 'c') { }
0 0 elsif ($input eq 'C') { }
0 0 elsif ($input eq 'm') { }
0 0 elsif ($input eq 'M') { }
0 0 elsif ($input eq 'f') { }
0 0 elsif ($input eq 'F') { }
0 0 elsif ($input eq 'r') { }
0 0 elsif ($input eq 'n') { }
0 0 elsif ($input eq 'p') { }
0 0 elsif ($input eq 'R') { }
1588 0 0 if ($heatmaps_invisible) { }
1597 0 0 if ($prompt_help)
1637 0 0 if $step >= @{$history_of{$display_mode};} - 1
1652 0 0 if $step >= @{$history_of{$display_mode};} - 1
1657 0 0 if ($depth <= $interaction_depth)
1674 0 0 if $step >= @{$history_of{$display_mode};} - 1
1675 0 0 if $history_of{$display_mode}[$step]{'is_match'}
1691 0 0 if $step >= @{$history_of{$display_mode};} - 1
1695 0 0 if $event->{'is_match'} and $depth <= $interaction_depth
1697 0 0 if ($depth <= $interaction_depth)
1714 0 0 if $step >= @{$history_of{$display_mode};} - 1
1715 0 0 if $history_of{$display_mode}[$step]{'is_fail'}
1731 0 0 if $step >= @{$history_of{$display_mode};} - 1
1735 0 0 if $event->{'is_fail'} and $depth <= $interaction_depth
1737 0 0 if ($depth <= $interaction_depth)
1754 0 0 if $step >= @{$history_of{$display_mode};} - 1
1755 0 0 if $history_of{$display_mode}[$step]{'depth'} < $interaction_depth
1763 0 0 if $step >= @{$history_of{$display_mode};} - 1
1765 0 0 if $step >= @{$history_of{$display_mode};} - 1
1792 0 0 if ($input ne '?')
1795 0 0 if ($display_mode eq 'events' or $display_mode eq 'JSON')
1796 0 0 unless ($lexical_config->{'save_to_fh'})
1811 0 0 if (defined $history_of{$display_mode}[$step]{'display'})
1839 0 0 unless ($no_window)
1848 0 0 if ($no_window)
1861 0 0 if ($capture{$name}{'start_pos'} > $regex_pos)
1872 0 0 if ($cap_len > $MAX_WIDTH)
1884 0 0 if (index($raw_regex_src, '$^N') >= 0 and defined $^N)
1889 0 0 if ($cap_len > $MAX_WIDTH)
1910 0 0 substr($data_mode, -7) eq 'heatmap' ? :
1916 0 0 $no_window ? :
1921 0 0 if ($data_mode ne 'full_heatmap') { }
1939 0 0 $is_capture && $forward_step > 1 ? :
0 0 $is_capture && $forward_step == 1 ? :
0 0 $nested_because eq 'failed' ? :
1956 0 0 substr($data_mode, -7) eq 'heatmap' ? :
1963 0 0 if ($match_start > $str_pos)
1969 0 0 substr($last_match_marker, 0, 1) eq '^' ? :
1978 0 0 $is_trying ? :
0 0 $nested_because eq 'failed' ? :
0 0 substr($data_mode, -7) eq 'heatmap' ? :
2005 0 0 unless ($no_window)
2014 0 0 if ($data_mode eq 'full_heatmap')
2045 0 0 $char eq "\t" ? :
0 0 $char eq "\n" ? :
2050 0 0 if (@graph and length $graph[-1]{'text'} . $display_char < $TABLE_STR_WIDTH and $graph[-1]{'heat'} == $abs_heat) { }
0 0 elsif ($char ne ' ' or $abs_heat != 0) { }
2153 0 1 eval { do { require JSON::Syck } } ? :
0 1 eval { do { require 5.014; require JSON::DWIW } } ? :
0 1 eval { do { require JSON } } ? :
0 1 eval { do { require JSON::XS } } ? :
2159 0 0 if $interaction_quit
2174 0 0 if (@{$state_ref->{'regex_problems'};})
2194 0 0 if ($construct_type eq '_START')
2200 0 0 if ($str_pos == 0)
2206 0 0 if ($event_ref->{'regex_failed'})
2207 0 0 if ($str_pos // 0) < length $str_src
2214 0 0 if ($nested_because eq 'failed')
2219 0 0 if (ref $capture_name)
2225 0 0 if ($matchable || $is_capture and $event_type eq 'post' and $construct ne '|')
2226 0 0 $shared_str_pos_ref ? :
2236 0 0 if ($nested_because ne 'failed')
2238 0 0 if ($str_pos < ($prev_str_pos // 0)) { }
0 0 elsif ($regex_pos < ($prev_regex_pos // 0)) { }
2253 0 0 if $event_type eq 'post' and $backtrack or not defined $pending_event_ID or $pending_event_ID == $event_ID
2268 0 0 if (ref $msg eq 'CODE')
2275 0 0 $construct_type eq '_START' ? :
0 0 pos $_ && pos $_ == $prev_str_pos && $construct_type eq '_START' ? :
0 0 defined $msg ? :
0 0 $event_type eq 'post' && ref $msg ? :
0 0 $event_type eq 'pre' && ref $msg ? :
0 0 $nested_because eq 'failed' ? :
2283 0 0 if ($regex_backtrack_len > 0)
2284 0 0 $construct_type ne '_named_subpattern_call' && index(lc $msg, 'failed') < 0 ? :
0 0 $event_type eq 'failed_nonbacktracking' ? :
2291 0 0 if ($re_idx >= 0)
2295 0 0 if ($re_idx >= 0)
2308 0 0 if ($forward_step) { }
0 0 elsif ($is_trying) { }
2317 0 0 if ($is_rematch or not $is_match || $is_fail || $is_skip)
2323 0 0 if ($construct_type eq '_capture_group')
2324 0 0 if ($event_type eq 'pre') { }
0 0 elsif ($event_type eq 'post') { }
2338 0 0 if ($is_pending)
2344 0 0 if ($shared_str_pos_ref and $event_type eq 'pre' and $construct ne '|')
2352 0 0 if (length $event_str > 1 or length $event_regex > 1)
2353 0 0 if length $event_str == 1
2354 0 0 if length $event_regex == 1
2355 0 0 $str_backtrack_len == 1 ? :
0 0 $event_str ? :
0 0 $event_str && $event_regex ? :
2371 0 0 if index('nrFMC', $interaction_mode) < 0 or $subpattern_depth <= $interaction_depth
2384 0 0 if index('nrFMC', $interaction_mode) < 0 or $subpattern_depth <= $interaction_depth
2388 0 0 if ($display_mode eq 'events' and not $lexical_config->{'save_to_fh'})
2389 0 0 if index('nrFMC', $interaction_mode) < 0 or $subpattern_depth <= $interaction_depth
2403 0 0 if (ref $data->{'event'}{'msg'} eq 'CODE')
2409 0 0 if (ref $starting_str_pos eq 'SCALAR' and ${$starting_str_pos;} and ${$starting_str_pos;} ne $str_pos)
2416 0 0 if ($construct_type eq '_START' and $str_pos == 0)
2422 0 0 $construct_type eq '_END' ? :
2427 0 0 if ($construct_type eq '_END')
2433 0 0 if ($display_mode eq 'JSON' and not $lexical_config->{'save_to_fh'})
2434 0 0 if index('nrFMC', $interaction_mode) < 0 or $subpattern_depth <= $interaction_depth
2456 0 0 unless $history_of{'visual'}
2465 0 0 if ($display_mode eq 'visual' and index('nrFMC', $interaction_mode) < 0 || $subpattern_depth <= $interaction_depth)
2477 0 0 if index('nrFMC', $interaction_mode) < 0 or $subpattern_depth <= $interaction_depth
2481 0 0 if $event_type ne 'break' and lc $interaction_mode eq 'm' && (!$is_match || $interaction_mode eq 'M' && $subpattern_depth > $interaction_depth) && index($msg, 'restarting regex match') < 0 && $construct_type ne '_END' || lc $interaction_mode eq 'f' && (!$is_fail || $interaction_mode eq 'F' && $subpattern_depth > $interaction_depth) && index($msg, 'restarting regex match') < 0 && $construct_type ne '_END' || $interaction_mode eq 'r' && $subpattern_depth > 0 && $subpattern_depth > $interaction_depth && index($msg, 'restarting regex match') < 0 && $construct_type ne '_END' || $interaction_mode eq 'n' && $subpattern_depth > $interaction_depth && index($msg, 'restarting regex match') < 0 || lc $interaction_mode eq 'c' && $construct_type ne '_END'
2515 0 0 if ($event_type eq 'break')
2523 0 0 if ($input eq "\cC") { }
0 0 elsif ($input eq 'x') { }
0 0 elsif ($input eq "\f") { }
0 0 elsif ($input eq 'd') { }
0 0 elsif ($input eq '?') { }
0 0 elsif ($input eq 'q' or $input eq "\cD") { }
0 0 elsif (index('-p', $input) >= 0) { }
0 0 elsif ($input eq 'R') { }
0 0 elsif ($input eq 'v') { }
0 0 elsif ($input eq 'h') { }
0 0 elsif ($input eq 'e') { }
0 0 elsif ($input eq 'j') { }
0 0 elsif ($input eq 'V') { }
0 0 elsif ($input eq 'H') { }
0 0 elsif ($input eq 'E') { }
0 0 elsif ($input eq 'J') { }
0 0 elsif ($input eq 'D') { }
0 0 elsif (index('fFmMnscC', $input) >= 0) { }
0 0 elsif ($input eq 'r') { }
2535 0 0 if ($display_mode eq 'events' or $display_mode eq 'JSON')
2563 0 0 if ($input eq 'q' or $input eq "\cD") { }
0 0 elsif (index('smnrMfFcC', $input) >= 0) { }
2580 0 0 if ($input eq 'q' or $input eq "\cD") { }
0 0 elsif (index('smnrMfFcC', $input) >= 0) { }
2602 0 0 if ($heatmaps_invisible) { }
2613 0 0 if ($prompt_help)
2660 0 0 if ($construct_type eq '_END')
2677 0 0 unless my $fh = delete $lexical_config->{'save_to_fh'}
2723 0 0 $save ? :
2727 0 0 if ($save) { }
2732 0 0 if ($pager eq 'less')
2735 0 0 unless open $STDOUT, '|-', $pager
2748 0 0 if ($save) { }
2757 0 0 if (length $indent . $info->{$_}{'construct'} > 20) { }
2768 0 0 if /^\d+$/
2815 0 0 unless (eval { do { require Time::HiRes } })
2828 0 0 if ($input eq "\n") { }
0 0 elsif ($input eq "\t") { }
2832 0 0 if ($filename eq 'less')
2852 0 0 unless (open my $fh, $open_mode, $filename)
2877 0 0 if ($data_mode eq 'JSON' and substr($state, -2) eq ",\n")
2923 0 0 if (@heatmap)
2926 0 0 if ($marker)
2931 0 0 if ($window)
2938 0 0 if (length $src > $window_width)
2940 0 0 if ($pos <= $mid_window) { }
0 0 elsif (length($src) - $pos < $mid_window) { }
2941 0 0 if ($marker)
2951 0 0 if (@heatmap)
2954 0 0 if ($marker)
2963 0 0 if (@heatmap)
2966 0 0 if ($marker)
2979 0 0 if (@heatmap) { }
0 0 elsif ($ws_colour) { }
2997 0 0 $ws_colouring ? :
3003 0 0 $ws_colouring ? :
3010 0 0 $ws_colouring ? :
3017 0 0 $ws_colouring ? :
3050 0 0 if ($char eq $special_char)
3051 0 0 if (length $prefix)
3065 0 0 if (length $prefix)
3075 0 0 if (index($msg, 'forgetting') >= 0 or index($msg, 'Forgetting') >= 0)
3078 0 0 if (index($msg, 'try') >= 0 or index($msg, 'Try') >= 0)
3081 0 0 if (index($msg, 'failed') >= 0 or index($msg, 'Failed') >= 0)
3084 0 0 if (index($msg, 'matched') >= 0 or index($msg, 'Matched') >= 0)
3107 0 0 if $lexical_config->{'save_to_fh'}
3120 1 0 if ($] >= 5.016) { }
3134 0 0 if (@_)
3140 0 0 if (ref $dumped_data eq 'HASH' and defined $dumped_data->{'regex_ID'}) { }
3154 0 0 if lc $cmd eq 'q'
3162 0 0 unless exec $^X, '-MRegexp::Debugger', @_
3187 0 0 if ($input =~ /^['"]$/) { }
0 0 elsif ($input eq '/') { }
3198 0 0 if ($input =~ m[^ (? [+]\s*[/]|[/"']) (? .*?) (? \k (? [imsxlaud]*) )? \s* \z ]x) { }
0 0 elsif ($input =~ /^ \s* [xXqQ]/x) { }
0 0 elsif ($input =~ /^ \s* [?hH]/x) { }
0 0 elsif ($input =~ /m/i) { }
0 0 elsif ($input =~ /g/i) { }
0 0 elsif ($input =~ /d/i) { }
3202 0 0 if ($cmd =~ m[[+]\s*[/]]msx)
3205 0 0 if $input eq ''
3206 0 0 if ($input =~ m[\A (?.*) [/][imsxlaud]*\Z]msx) { }
3217 0 0 if ($cmd eq '/') { }
0 0 elsif ($+{'cmd'} eq '"') { }
0 0 elsif ($+{'cmd'} eq q[']) { }
3218 0 0 if ($data eq '') { }
3230 0 0 if (not defined $regex) { }
3244 0 0 if $@
3245 0 0 unless defined $string
3254 0 0 if $@
3255 0 0 unless defined $string
3277 0 0 if (eval { do { require IO::Prompter } })
3315 0 0 if (defined $string and defined $input_regex)
3342 0 0 if $index < 0