Branch Coverage

blib/lib/Regexp/Debugger.pm
Criterion Covered Total %
branch 19 688 2.7


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+)\)/) { }
340 0 0 if $regex_cache{$obj_id}
345 0 0 unless (eval { do { qr/$cooked/x } })
349 0 0 unless (eval { do { qr/$cooked/ } })
379 0 0 $] <= 5.022 || $] >= 5.032 ? :
415 0 0 $x_flag ? :
437 0 0 $start_line == $end_line ? :
492 0 0 !$Regexp::Debugger::in_quote ? :
496 0 0 $Regexp::Debugger::in_quote ? :
677 0 0 $^N == 1 ? :
680 0 0 $^N == 1 ? :
715 0 0 substr($+{'_charset'}, 0, 2) eq '[^' ? :
727 0 0 $^N == 1 ? :
797 0 0 exists $+{'whitespace_chars'} ? :
0 0 exists $+{'tab_char'} ? :
0 0 exists $+{'newline_char'} ? :
804 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'}) { }
829 0 0 $steps != 1 ? :
833 0 0 if ($match_was_null and $prev_match_was_null) { }
850 0 0 $steps != 1 ? :
0 0 $steps ? :
861 0 0 if (my $reset = $paren_stack[-1]{'is_branch_reset'})
892 0 0 $_ eq ' ' ? :
0 0 $_ eq "\t" ? :
0 0 $_ eq "\n" ? :
1014 0 0 $is_subpattern_call ? :
1018 0 0 $is_subpattern_call ? :
1025 0 0 length $quantifier_desc ? :
0 0 length $quantifier_desc ? :
0 0 $is_subpattern_call ? :
1241 0 0 length $construct > 3 ? :
1246 0 0 if ($neg >= 0)
1248 0 0 if ($x >= 0)
1249 0 0 if ($x < $neg) { }
1308 0 0 if ($paren_stack[-2]{'is_conditional'} and $paren_stack[-2]{'is_pending'}) { }
1380 0 0 unless (@{$capture_names_for[$next_capture_group] // [];})
1415 0 0 if ($paren_data->{'is_branch_reset'})
1427 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'} ? :
1431 0 0 if (length $std_info{'quantifier'})
1436 0 0 if (exists $paren_data->{'reinstate_x_flag'})
1468 0 0 ref $msg ? :
0 0 $paren_data->{'is_nonbacktrack'} ? :
1534 0 0 @{$history_of{$data_mode} // [];} ? :
1546 0 0 if ($display_mode eq $data_mode)
1547 0 0 if (not $lexical_config->{'save_to_fh'} or $data_mode ne 'JSON')
1577 0 0 if $is_fail
1578 0 0 if $is_match
1592 0 0 if $step >= @{$history_of{$display_mode};}
1595 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') { }
1631 0 0 if ($heatmaps_invisible) { }
1640 0 0 if ($prompt_help)
1680 0 0 if $step >= @{$history_of{$display_mode};} - 1
1695 0 0 if $step >= @{$history_of{$display_mode};} - 1
1700 0 0 if ($depth <= $interaction_depth)
1717 0 0 if $step >= @{$history_of{$display_mode};} - 1
1718 0 0 if $history_of{$display_mode}[$step]{'is_match'}
1734 0 0 if $step >= @{$history_of{$display_mode};} - 1
1738 0 0 if $event->{'is_match'} and $depth <= $interaction_depth
1740 0 0 if ($depth <= $interaction_depth)
1757 0 0 if $step >= @{$history_of{$display_mode};} - 1
1758 0 0 if $history_of{$display_mode}[$step]{'is_fail'}
1774 0 0 if $step >= @{$history_of{$display_mode};} - 1
1778 0 0 if $event->{'is_fail'} and $depth <= $interaction_depth
1780 0 0 if ($depth <= $interaction_depth)
1797 0 0 if $step >= @{$history_of{$display_mode};} - 1
1798 0 0 if $history_of{$display_mode}[$step]{'depth'} < $interaction_depth
1806 0 0 if $step >= @{$history_of{$display_mode};} - 1
1808 0 0 if $step >= @{$history_of{$display_mode};} - 1
1835 0 0 if ($input ne '?')
1838 0 0 if ($display_mode eq 'events' or $display_mode eq 'JSON')
1839 0 0 unless ($lexical_config->{'save_to_fh'})
1854 0 0 if (defined $history_of{$display_mode}[$step]{'display'})
1882 0 0 unless ($no_window)
1891 0 0 if ($no_window)
1904 0 0 if ($capture{$name}{'start_pos'} > $regex_pos)
1915 0 0 if ($cap_len > $MAX_WIDTH)
1927 0 0 if (index($raw_regex_src, '$^N') >= 0 and defined $^N)
1932 0 0 if ($cap_len > $MAX_WIDTH)
1953 0 0 substr($data_mode, -7) eq 'heatmap' ? :
1959 0 0 $no_window ? :
1964 0 0 if ($data_mode ne 'full_heatmap') { }
1982 0 0 $is_capture && $forward_step > 1 ? :
0 0 $is_capture && $forward_step == 1 ? :
0 0 $nested_because eq 'failed' ? :
1999 0 0 substr($data_mode, -7) eq 'heatmap' ? :
2006 0 0 if ($match_start > $str_pos)
2012 0 0 substr($last_match_marker, 0, 1) eq '^' ? :
2021 0 0 $is_trying ? :
0 0 $nested_because eq 'failed' ? :
0 0 substr($data_mode, -7) eq 'heatmap' ? :
2048 0 0 unless ($no_window)
2057 0 0 if ($data_mode eq 'full_heatmap')
2088 0 0 $char eq "\t" ? :
0 0 $char eq "\n" ? :
2093 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) { }
2196 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 } } ? :
2202 0 0 if $interaction_quit
2217 0 0 if (@{$state_ref->{'regex_problems'};})
2237 0 0 if ($construct_type eq '_START')
2243 0 0 if ($str_pos == 0)
2249 0 0 if ($event_ref->{'regex_failed'})
2250 0 0 if ($str_pos // 0) < length $str_src
2257 0 0 if ($nested_because eq 'failed')
2262 0 0 if (ref $capture_name)
2268 0 0 if ($matchable || $is_capture and $event_type eq 'post' and $construct ne '|')
2269 0 0 $shared_str_pos_ref ? :
2279 0 0 if ($nested_because ne 'failed')
2281 0 0 if ($str_pos < ($prev_str_pos // 0)) { }
0 0 elsif ($regex_pos < ($prev_regex_pos // 0)) { }
2296 0 0 if $event_type eq 'post' and $backtrack or not defined $pending_event_ID or $pending_event_ID == $event_ID
2311 0 0 if (ref $msg eq 'CODE')
2318 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' ? :
2326 0 0 if ($regex_backtrack_len > 0)
2327 0 0 $construct_type ne '_named_subpattern_call' && index(lc $msg, 'failed') < 0 ? :
0 0 $event_type eq 'failed_nonbacktracking' ? :
2334 0 0 if ($re_idx >= 0)
2338 0 0 if ($re_idx >= 0)
2351 0 0 if ($forward_step) { }
0 0 elsif ($is_trying) { }
2360 0 0 if ($is_rematch or not $is_match || $is_fail || $is_skip)
2366 0 0 if ($construct_type eq '_capture_group')
2367 0 0 if ($event_type eq 'pre') { }
0 0 elsif ($event_type eq 'post') { }
2381 0 0 if ($is_pending)
2387 0 0 if ($shared_str_pos_ref and $event_type eq 'pre' and $construct ne '|')
2395 0 0 if (length $event_str > 1 or length $event_regex > 1)
2396 0 0 if length $event_str == 1
2397 0 0 if length $event_regex == 1
2398 0 0 $str_backtrack_len == 1 ? :
0 0 $event_str ? :
0 0 $event_str && $event_regex ? :
2414 0 0 if index('nrFMC', $interaction_mode) < 0 or $subpattern_depth <= $interaction_depth
2427 0 0 if index('nrFMC', $interaction_mode) < 0 or $subpattern_depth <= $interaction_depth
2431 0 0 if ($display_mode eq 'events' and not $lexical_config->{'save_to_fh'})
2432 0 0 if index('nrFMC', $interaction_mode) < 0 or $subpattern_depth <= $interaction_depth
2446 0 0 if (ref $data->{'event'}{'msg'} eq 'CODE')
2452 0 0 if (ref $starting_str_pos eq 'SCALAR' and ${$starting_str_pos;} and ${$starting_str_pos;} ne $str_pos)
2459 0 0 if ($construct_type eq '_START' and $str_pos == 0)
2465 0 0 $construct_type eq '_END' ? :
2470 0 0 if ($construct_type eq '_END')
2476 0 0 if ($display_mode eq 'JSON' and not $lexical_config->{'save_to_fh'})
2477 0 0 if index('nrFMC', $interaction_mode) < 0 or $subpattern_depth <= $interaction_depth
2499 0 0 unless $history_of{'visual'}
2508 0 0 if ($display_mode eq 'visual' and index('nrFMC', $interaction_mode) < 0 || $subpattern_depth <= $interaction_depth)
2520 0 0 if index('nrFMC', $interaction_mode) < 0 or $subpattern_depth <= $interaction_depth
2524 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'
2558 0 0 if ($event_type eq 'break')
2566 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') { }
2578 0 0 if ($display_mode eq 'events' or $display_mode eq 'JSON')
2606 0 0 if ($input eq 'q' or $input eq "\cD") { }
0 0 elsif (index('smnrMfFcC', $input) >= 0) { }
2623 0 0 if ($input eq 'q' or $input eq "\cD") { }
0 0 elsif (index('smnrMfFcC', $input) >= 0) { }
2645 0 0 if ($heatmaps_invisible) { }
2656 0 0 if ($prompt_help)
2703 0 0 if ($construct_type eq '_END')
2720 0 0 unless my $fh = delete $lexical_config->{'save_to_fh'}
2766 0 0 $save ? :
2770 0 0 if ($save) { }
2775 0 0 if ($pager eq 'less')
2778 0 0 unless open $STDOUT, '|-', $pager
2791 0 0 if ($save) { }
2800 0 0 if (length $indent . $info->{$_}{'construct'} > 20) { }
2811 0 0 if /^\d+$/
2858 0 0 unless (eval { do { require Time::HiRes } })
2871 0 0 if ($input eq "\n") { }
0 0 elsif ($input eq "\t") { }
2875 0 0 if ($filename eq 'less')
2895 0 0 unless (open my $fh, $open_mode, $filename)
2920 0 0 if ($data_mode eq 'JSON' and substr($state, -2) eq ",\n")
2966 0 0 if (@heatmap)
2969 0 0 if ($marker)
2974 0 0 if ($window)
2981 0 0 if (length $src > $window_width)
2983 0 0 if ($pos <= $mid_window) { }
0 0 elsif (length($src) - $pos < $mid_window) { }
2984 0 0 if ($marker)
2994 0 0 if (@heatmap)
2997 0 0 if ($marker)
3006 0 0 if (@heatmap)
3009 0 0 if ($marker)
3022 0 0 if (@heatmap) { }
0 0 elsif ($ws_colour) { }
3040 0 0 $ws_colouring ? :
3046 0 0 $ws_colouring ? :
3053 0 0 $ws_colouring ? :
3060 0 0 $ws_colouring ? :
3093 0 0 if ($char eq $special_char)
3094 0 0 if (length $prefix)
3108 0 0 if (length $prefix)
3118 0 0 if (index($msg, 'forgetting') >= 0 or index($msg, 'Forgetting') >= 0)
3121 0 0 if (index($msg, 'try') >= 0 or index($msg, 'Try') >= 0)
3124 0 0 if (index($msg, 'failed') >= 0 or index($msg, 'Failed') >= 0)
3127 0 0 if (index($msg, 'matched') >= 0 or index($msg, 'Matched') >= 0)
3150 0 0 if $lexical_config->{'save_to_fh'}
3163 1 0 if ($] >= 5.016) { }
3177 0 0 if (@_)
3183 0 0 if (ref $dumped_data eq 'HASH' and defined $dumped_data->{'regex_ID'}) { }
3197 0 0 if lc $cmd eq 'q'
3205 0 0 unless exec $^X, '-MRegexp::Debugger', @_
3230 0 0 if ($input =~ /^['"]$/) { }
0 0 elsif ($input eq '/') { }
3241 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) { }
3245 0 0 if ($cmd =~ m[[+]\s*[/]]msx)
3248 0 0 if $input eq ''
3249 0 0 if ($input =~ m[\A (?.*) [/][imsxlaud]*\Z]msx) { }
3260 0 0 if ($cmd eq '/') { }
0 0 elsif ($+{'cmd'} eq '"') { }
0 0 elsif ($+{'cmd'} eq q[']) { }
3261 0 0 if ($data eq '') { }
3273 0 0 if (not defined $regex) { }
3287 0 0 if $@
3288 0 0 unless defined $string
3297 0 0 if $@
3298 0 0 unless defined $string
3320 0 0 if (eval { do { require IO::Prompter } })
3358 0 0 if (defined $string and defined $input_regex)
3385 0 0 if $index < 0