blib/lib/Acme/CPANModules/DiffWrappers.pm

filter: Statementstmt 100% 13 / 13 Branchbran 100% 4 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 1 / 1 Podpod n/a totaltotal 100% 18 / 18 SCAR 11.0
CC
3
Cov
100%
_includes
3.0
CRAP 3.0
↑ Summary
1 package Acme::CPANModules::DiffWrappers;
2  
3 1 our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY
4 1 our $DATE = '2020-10-27'; # DATE
5 1 our $DIST = 'Acme-CPANModules-DiffWrappers'; # DIST
6 1 our $VERSION = '0.003'; # VERSION
7  
8 1 require Acme::CPANModules::CLI::Wrapper::UnixCommand;
9 1 my $srclist = $Acme::CPANModules::CLI::Wrapper::UnixCommand::LIST;
10  
11 sub _includes {
12 13 ▶ my ($list, $item) = @_;
Subroutine _includes: called CC=3 SCAR=11.0
13 13 ▶ ref $list eq 'ARRAY' ? ((grep {$_ eq $item} @$list) ? 1:0) : ($list eq $item);
Branch: 2 branches
BranchTrueFalseTotal
ref $list eq 'ARRAY' ? : 3 10 13
grep({$_ eq $item;} @$list) ? : 1 2 3
14 }
15  
16 our $LIST = {
17 summary => "Wrappers for the diff Unix command",
18 entries => [
19 1 grep { _includes($_->{'x.command'}, 'diff') } @{ $srclist->{entries} }
20 ],
21 };
22  
23 1 1;
24 # ABSTRACT: Wrappers for the diff Unix command
25  
26 __END__
↑ Summary