Branch Coverage

blib/lib/Curses/UI/TextEditor.pm
Criterion Covered Total %
branch 56 262 21.3


line true false branch
189 0 1 unless defined $args{-'text'}
193 0 1 if $args{-'wrapping'}
196 0 1 if ($args{-'singleline'})
206 0 1 if $$this{-'singleline'}
216 0 1 if defined $$this{-'password'}
219 0 0 if ($$this{-'singleline'} and defined $$this{-'text'} and $$this{-'text'} =~ /\n/)
229 1 0 if ($Curses::UI::ncurses_mouse)
242 4 0 if $length <= 0
259 0 1 unless $this->SUPER::layout
295 0 4 if $Curses::UI::screen_too_small
306 0 4 unless @$lines_src
309 0 4 unless defined $$this{-'pos'}
310 0 4 if $$this{-'pos'} < 0
311 2 2 if $$this{-'pos'} >= length $$this{-'text'}
322 0 4 if ($$this{-'wrapping'}) { }
329 4 0 unless (defined $xpos)
334 4 0 if ($$this{-'pos'} < $newtrackpos)
339 4 0 if defined $xpos
346 4 0 unless ($$this{-'readonly'})
357 0 4 if ($$this{-'ypos'} - $$this{-'yscrpos'} >= $this->canvasheight) { }
0 4 elsif ($$this{-'ypos'} < $$this{-'yscrpos'}) { }
367 0 4 if $$this{-'yscrpos'} < 0
368 0 4 if $$this{-'yscrpos'} > @$lines
377 4 0 unless ($$this{-'readonly'})
379 4 0 if (not $$this{-'wrapping'}) { }
386 4 0 !$$this{-'wrapping'} && $$this{-'showoverflow'} ? :
391 4 0 if ($realxpos < $wrapborder)
400 0 4 if ($realxpos > $this->canvaswidth - 1 - $wrapborder)
414 0 4 if $$this{-'xscrpos'} < 0
415 0 4 if $$this{-'xscrpos'} > $$this{-'xpos'}
421 0 4 if ($$this{-'hscrollbar'} and not $$this{-'wrapping'} or $$this{-'readonly'}) { }
436 0 4 if ($$this{-'vscrollbar'} or $$this{-'readonly'}) { }
452 0 1 if $Curses::UI::screen_too_small
455 0 1 if $this->hidden
459 0 1 if ($$this{-'showlines'} or $$this{-'reverse'})
461 0 0 if $$this{-'showlines'}
462 0 0 if $$this{-'reverse'}
472 0 2 if ($Curses::UI::color_support)
482 0 2 if (defined $$this{-'search_highlight'} and $$this{-'search_highlight'} == $id + $$this{-'yscrpos'}) { }
484 0 0 unless $$this{-'reverse'}
485 0 0 if $$this{-'reverse'}
487 2 0 unless $$this{-'reverse'}
488 0 2 if $$this{-'reverse'}
492 1 1 if (defined $l) { }
497 1 0 if ($$this{-'xscrpos'} < length $l)
507 0 1 if ($$this{-'singleline'} and defined $$this{-'password'})
525 0 1 if ($inscreen =~ /\n/) { }
529 0 0 if ($$this{-'showhardreturns'})
531 0 0 if ($this->root->compat) { }
545 1 0 if (not $$this{-'wrapping'} and $$this{-'showoverflow'})
547 1 0 if $this->canvaswidth < scrlength($fromxscr)
549 0 1 if $$this{-'xscrpos'} > 0
560 0 1 if ($$this{-'readonly'}) { }
581 0 1 if $$this{-'showlines'}
582 0 1 if $$this{-'reverse'}
584 0 1 unless $no_doupdate
593 0 1 unless $this->SUPER::draw(1)
597 0 1 unless $no_doupdate
610 0 0 if ($$this{-'homeonblur'})
630 0 0 if (defined $$this{-'prevkey'} and $$this{-'prevkey'} ne $key) { }
643 0 0 unless $$this{-'focus'}
646 0 0 if ($$this{-'toupper'}) { }
0 0 elsif ($$this{-'tolower'}) { }
654 0 0 if ($$this{-'maxlength'})
655 0 0 if length $$this{-'text'} > $$this{-'maxlength'}
657 0 0 if (not $is_illegal and defined $$this{-'maxlines'})
659 0 0 if @$lines > $$this{-'maxlines'}
661 0 0 if (not $is_illegal and defined $$this{-'regexp'})
666 0 0 if ($is_illegal) { }
699 0 0 unless defined $binding
701 0 0 if ($ch eq '-1') { }
0 0 elsif ($binding eq 'add-string') { }
0 0 elsif ($binding eq 'newline') { }
731 0 0 if $$this{-'singleline'}
740 0 0 if $$this{-'singleline'}
750 0 0 if ($$this{-'readonly'})
752 0 0 unless defined $$this{-'hscrolllen'}
755 0 0 if $$this{-'xscrpos'} >= $$this{-'hscrolllen'} - $this->canvaswidth
766 0 0 if ($$this{-'pos'} == length $$this{-'text'}) { }
781 0 0 if ($$this{-'readonly'})
783 0 0 if $$this{-'xscrpos'} <= 0
789 0 0 if ($$this{-'pos'} <= 0) { }
812 0 0 if $$this{-'singleline'}
815 0 0 if ($$this{-'readonly'})
817 0 0 if $$this{-'yscrpos'} <= 0
819 0 0 if $$this{-'yscrpos'} < 0
825 0 0 unless $maymove
826 0 0 if $amount > $maymove
848 0 0 if $$this{-'singleline'}
860 0 0 if $$this{-'singleline'}
863 0 0 if ($$this{-'readonly'})
866 0 0 if $$this{-'yscrpos'} >= $max
870 0 0 if $$this{-'yscrpos'} > $max
877 0 0 unless $maymove
878 0 0 if $amount > $maymove
898 0 0 if $$this{-'singleline'}
909 0 0 if ($$this{-'readonly'})
925 0 0 if ($$this{-'readonly'})
944 0 0 if ($$this{-'readonly'})
952 0 0 if defined $from_binding
961 0 0 if ($$this{-'readonly'})
974 0 0 if defined $from_binding
988 0 0 if $newpos <= 0
990 0 0 if substr($$this{-'text'}, $newpos, 1) eq "\n"
992 0 0 unless $newpos == 0
993 0 0 if $newpos > length $$this{-'text'}
1003 0 0 unless defined $right
1005 0 0 if ($right > $len)
1022 0 0 if $$this{-'singleline'}
1025 0 0 if ($len == 0)
1050 0 0 if substr($$this{-'text'}, $$this{-'pos'}, 1) eq "\n"
1057 0 0 if $pos >= length $$this{-'text'}
1058 0 0 if substr($$this{-'text'}, $pos, 1) eq "\n"
1074 0 0 if ($$this{-'pos'} >= length $$this{-'text'}) { }
1091 0 0 if ($$this{-'pos'} <= 0) { }
1106 0 0 if $$this{-'singleline'}
1117 0 0 unless $$this{-'focusable'}
1120 0 0 if ($$this{-'singleline'})
1138 0 0 if $this->didsetundo
1144 0 0 if ($l and @{$$this{-'undotext'};} > $l)
1157 0 0 if (@{$$this{-'undotext'};})
1171 0 0 if defined $value
1173 0 0 unless defined $$this{-'pastebuffer'}
1190 0 0 if $this->do_new_pastebuffer
1191 0 0 if ($is_backward) { }
1204 0 0 if ($$this{-'pastebuffer'} ne '')
1217 0 1 if ($readonly) { }
1243 0 0 if (defined $pos)
1257 1 1 if (defined $text)
1271 0 0 if defined $char
1285 0 0 if length $_ > $columns