Completion/_readkey.pm

filter: Statementstmt 80.7% 21 / 26 Branchbran 50.0% 6 / 12 Conditioncond 33.3% 3 / 9 MC/DCmcdc 0.0% 0 / 6 Subroutinesub 83.3% 5 / 6 Podpod 100% 3 / 3 totaltotal 61.2% 38 / 62 CC 9 SCAR 19.0
CC
9
Cov
64%
__ANON__
11.6
set_raw_tty
2.0
reset_tty
2.0
CRAP 6.7
« Completion/Multi.pm ↑ Summary Completion/_POSIX.pm »
1 package Term::Completion::_readkey;
2
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Term::ReadKey qw(ReadMode ReadKey GetTerminalSize);
Subroutine BEGIN: called CC=1 SCAR=0.0
5
6 sub set_raw_tty
7 {
8 1 ▶ my __PACKAGE__ $this = shift;
Subroutine set_raw_tty: called CC=2 SCAR=7.1
Pod documented
9 1 ▶ ReadMode 4, $this->{in} if -t $this->{in};
Branch: 1 branch
BranchTrueFalseTotal
if -t $this->{"in"} 0 1 1
10 1 1;
11 }
12
13 sub reset_tty
14 {
15 1 ▶ my __PACKAGE__ $this = shift;
Subroutine reset_tty: called CC=2 SCAR=7.1
Pod documented
16 1 ▶ ReadMode 0, $this->{in} if -t $this->{in};
Branch: 1 branch
BranchTrueFalseTotal
if -t $this->{"in"} 0 1 1
17 1 1;
18 }
19
20 sub get_key
21 {
22 0 ▶ my __PACKAGE__ $this = shift;
Subroutine get_key: not called CC=1 SCAR=6.9
Pod documented
23 0 ReadKey(0, $this->{in});
24 }
25
26 2 ▶if($^O =~ /interix|win/i) {
Branch: 1 branch
BranchTrueFalseTotal
if ($^O =~ /interix|win/i) { } 0 2 2
27 0 require Term::Completion::_termsize;
28 0 *get_term_size = \&Term::Completion::_termsize::get_term_size;
29 } else {
30 *get_term_size = sub {
31 1 ▶ my __PACKAGE__ $this = shift;
Subroutine __ANON__: called CC=7 SCAR=24.5
32 1 ▶ if(defined $this->{columns} and defined $this->{rows}) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $this->{"columns"} and defined $this->{"rows"}) 0 1 1
Condition33%1/3
defined $this->{"columns"} and defined $this->{"rows"}
!ll&&!rl&&r
100
MC/DC0%0/2
defined $this->{"columns"} and defined $this->{"rows"}
defined $this->{"columns"} defined $this->{"rows"}
Truth table33%1/3
A and B
A= defined $this->{"columns"}B= defined $this->{"rows"}
ABresult
0X0
100
111
33 0 return($this->{columns}, $this->{rows});
34 }
35 1 my ($c,$r) = GetTerminalSize($this->{out});
36 1 ▶ $c ||= $Term::Completion::DEFAULTS{columns};
Condition33%1/3
$c ||= $Term::Completion::DEFAULTS{"columns"}
l!l&&r!l&&!r
010
MC/DC0%0/2
$c ||= $Term::Completion::DEFAULTS{"columns"}
$c $Term::Completion::DEFAULTS{"columns"}
Truth table33%1/3
A ||= B
A= $cB= $Term::Completion::DEFAULTS{"columns"}
ABresult
1X1
011
000
37 1 ▶ $r ||= $Term::Completion::DEFAULTS{rows};
Condition33%1/3
$r ||= $Term::Completion::DEFAULTS{"rows"}
l!l&&r!l&&!r
010
MC/DC0%0/2
$r ||= $Term::Completion::DEFAULTS{"rows"}
$r $Term::Completion::DEFAULTS{"rows"}
Truth table33%1/3
A ||= B
A= $rB= $Term::Completion::DEFAULTS{"rows"}
ABresult
1X1
011
000
38 return (
39 (defined $this->{columns} ? $this->{columns} : $c),
40 1 ▶ (defined $this->{rows} ? $this->{rows} : $r)
Branch: 2 branches
BranchTrueFalseTotal
defined $this->{'columns'} ? : 0 1 1
defined $this->{'rows'} ? : 0 1 1
41 );
42 2 };
43 }
44
45 2 1;
46
47 __END__
« Completion/Multi.pm ↑ Summary Completion/_POSIX.pm »