test/lib/RandomFileMethodAllTests.pm

filter: Statementstmt 100% 32 / 32 Branchbran 100% 6 / 6 Conditioncond 66.6% 4 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 100% 8 / 8 Podpod 33.3% 1 / 3 totaltotal 86.4% 51 / 59 SCAR 19.5
CC
7
Cov
95%
random_file
3.0
content_of_random_file
3.0
runtests
3.0
CRAP 7.0
« test/lib/RandomFileMethodBase.pm ↑ Summary test/lib/RandomFileSimpleDirOption.pm »
1 package RandomFileMethodAllTests;
2 1 use base qw/RandomFileSimpleDirOption
3 RandomFileCheckOption
4 RandomFileRecursiveOption
5 RandomFilePassesPathsToCheckRoutine
6 1 ▶ RandomFileWithUnknownParameters/;
Subroutine BEGIN: called CC=1 SCAR=0.0
7
8 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 1 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 1 use constant ALIASES =>({},
14 {-dir => '-d', -recursive => '-r', -check => '-c'},
15 1 ▶ {-dir => '-directory', '-recursive' => '-rec'});
Subroutine BEGIN: called CC=1 SCAR=0.0
16  
17 1 my %current_aliases;
18  
19 sub random_file {
20 18060 ▶ my ($self, %args) = @_;
Subroutine random_file: called CC=3 SCAR=11.0
Pod undocumented
21 18060 my %alias_args;
22 18060 ▶ while (my ($option, $value) = each %args) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %args) 30828 18060 48888
23 30828 ▶ $alias_args{ $current_aliases{$option} || $option } = $value;
Condition66%2/3
$current_aliases{$option} || $option
l!l&&r!l&&!r
18780120480
MC/DC0%0/2
$current_aliases{$option} || $option
$current_aliases{$option} $option
Truth table66%2/3
A || B
A= $current_aliases{$option}B= $option
ABresult
1X1
011
000
24 }
25 18060 return $self->SUPER::random_file(%alias_args);
26 }
27  
28 sub content_of_random_file {
29 18060 ▶ my ($self, %args) = @_;
Subroutine content_of_random_file: called CC=3 SCAR=11.0
Pod undocumented
30 18060 my %alias_args;
31 18060 ▶ while (my ($option, $value) = each %args) {
Branch: 1 branch
BranchTrueFalseTotal
if (() = each %args) 43620 18060 61680
32 43620 ▶ $alias_args{ $current_aliases{$option} || $option } = $value;
Condition66%2/3
$current_aliases{$option} || $option
l!l&&r!l&&!r
23044205760
MC/DC0%0/2
$current_aliases{$option} || $option
$current_aliases{$option} $option
Truth table66%2/3
A || B
A= $current_aliases{$option}B= $option
ABresult
1X1
011
000
33 }
34 18060 return $self->SUPER::content_of_random_file(%alias_args);
35 }
36  
37 # Quite a dirty trick to overwrite runtests
38 # but I want to run all tests for every alias one time
39 #
40 # If you know something better, please email me
41 sub runtests {
42 2 ▶ my $self = shift;
Subroutine runtests: called CC=3 SCAR=11.0
Pod documented
43 2 foreach (ALIASES) {
44 6 %current_aliases = %$_;
45 6 ▶ diag("Test aliases: ", %current_aliases) if %current_aliases;
Branch: 1 branch
BranchTrueFalseTotal
if %current_aliases 4 2 6
46 6 $self->SUPER::runtests();
47 }
48 }
49  
50 1 1;
« test/lib/RandomFileMethodBase.pm ↑ Summary test/lib/RandomFileSimpleDirOption.pm »