| 1 | package Test::Pod::Coverage::TrustMe; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 14 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 14 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 14 | our $VERSION = '0.002002'; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | 14 | $VERSION =~ tr/_//d; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | 14 | ▶ | use File::Spec (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 14 | ▶ | use Cwd (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 14 | ▶ | use Test::Builder (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 14 | ▶ | use Exporter (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | 14 | *import = \&Exporter::import; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 14 | our @EXPORT = qw( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | all_modules | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | pod_coverage_ok | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | all_pod_coverage_ok | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | 1 | ▶ | sub _blib { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_blib: called CC=5 SCAR=19.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | 1 | my $dir = File::Spec->curdir; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 1 | my $try = 5; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | 1 | ▶ | while ($try--) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | 1 | my $blib = File::Spec->catdir($dir, 'blib'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 1 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%2/6
-d $blib and -d "File::Spec"->catdir($blib, "arch") and -d "File::Spec"->catdir($blib, "lib")
-d $blib and -d "File::Spec"->catdir($blib, "arch")
MC/DC0%0/3
-d $blib and -d "File::Spec"->catdir($blib, "arch") and -d "File::Spec"->catdir($blib, "lib")
-d $blib
-d "File::Spec"->catdir($blib, "arch")
-d "File::Spec"->catdir($blib, "lib")
Truth table25%1/4
A and B and C
A= -d $blibB= -d "File::Spec"->catdir($blib, "arch")C= -d "File::Spec"->catdir($blib, "lib")
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 27 | -d $blib | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 28 | && -d File::Spec->catdir($blib, 'arch') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 29 | && -d File::Spec->catdir($blib, 'lib') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 30 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 31 | 1 | return $blib; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 32 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 34 | 0 | $dir = File::Spec->catdir($dir, File::Spec->updir); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 35 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 36 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 37 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 39 | 1 | ▶ | sub _lib { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_lib: called CC=7 SCAR=24.7
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 40 | 1 | my $dir = File::Spec->curdir; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 41 | 1 | my $try = 5; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 42 | 1 | ▶ | while ($try--) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 43 | 1 | my $lib = File::Spec->catdir($dir, 'lib'); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 44 | 1 | ▶ | if (-d $lib) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 45 | 1 | my @parts = File::Spec->splitdir(Cwd::realpath($lib)); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 46 | 1 | ▶ | if ( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%3/9
@parts >= 2 and $parts[-1] eq "lib" and $parts[-2] eq "t" || $parts[-2] eq "xt"
@parts >= 2 and $parts[-1] eq "lib"
$parts[-2] eq "t" or $parts[-2] eq "xt"
MC/DC0%0/4
@parts >= 2 and $parts[-1] eq "lib" and $parts[-2] eq "t" || $parts[-2] eq "xt"
@parts >= 2
$parts[-1] eq "lib"
$parts[-2] eq "t"
$parts[-2] eq "xt"
Truth table20%1/5
A and B and C or D
A= @parts >= 2B= $parts[-1] eq "lib"C= $parts[-2] eq "t"D= $parts[-2] eq "xt"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 47 | @parts >= 2 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 48 | && $parts[-1] eq 'lib' | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 49 | && ($parts[-2] eq 't' || $parts[-2] eq 'xt') | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 50 | ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 51 | 0 | next; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 52 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 53 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 54 | 1 | return $lib; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 55 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 56 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 57 | 0 | $dir = File::Spec->catdir($dir, File::Spec->updir); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 58 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 59 | 0 | return undef; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 60 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 61 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 62 | 1 | ▶ | sub _base_dirs { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_base_dirs: called CC=3 SCAR=11.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 63 | 1 | my %find; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 64 | 1 | ▶ | if (my $lib = _lib()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 65 | 1 | $find{Cwd::realpath($lib)}++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 66 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 67 | 1 | ▶ | if (my $blib = _blib()) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 68 | 1 | $find{Cwd::realpath(File::Spec->catdir($blib, 'arch'))}++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 69 | 1 | $find{Cwd::realpath(File::Spec->catdir($blib, 'lib'))}++; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 70 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 72 | 1 | my @dirs = grep $find{Cwd::realpath($_)}, @INC; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 73 | 1 | return @dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 76 | 1 | ▶ | sub all_modules { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
all_modules: called CC=7 SCAR=19.6
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 77 | 1 | my @dirs = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 78 | 1 | ▶ | @dirs = _base_dirs | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 79 | if !@dirs; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 80 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 81 | 1 | my %searched; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 82 | my @modules; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 83 | 1 | my %modules; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 85 | 1 | my @search = map [$_], @dirs; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 86 | 1 | ▶ | while (my $search = shift @search) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 87 | 17 | my ($dir, @pre) = @$search; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 88 | next | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 89 | 17 | ▶ | if $searched{Cwd::realpath($dir)}++; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 90 | 16 | ▶ | opendir my $dh, $dir or die; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 91 | 16 | my @found = File::Spec->no_upwards(readdir $dh); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 92 | 16 | closedir $dh; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 93 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 94 | 16 | ▶ | my @mods = grep /\.pm\z/ && -f File::Spec->catfile($dir, $_), @found; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
/\.pm\z/ && -f 'File::Spec'->catfile($dir, $_)
MC/DC50%1/2
/\.pm\z/ && -f 'File::Spec'->catfile($dir, $_)
/\.pm\z/
-f 'File::Spec'->catfile($dir, $_)
Truth table66%2/3
A && B
A= /\.pm\z/B= -f 'File::Spec'->catfile($dir, $_)
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 95 | 16 | s/\.pm\z// for @mods; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 96 | push @modules, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 97 | 16 | grep !$modules{$_}++, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 98 | map join('::', @pre, $_), | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 99 | grep !/\W/, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 100 | @mods; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 101 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 102 | 16 | unshift @search, | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 103 | map [ $_->[0], @pre, $_->[1] ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 104 | grep -d $_->[0], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 105 | map [ File::Spec->catdir($dir, $_) => $_ ], | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 106 | grep !/\W/, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 107 | @found; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 108 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 109 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 110 | 1 | return @modules; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 111 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 112 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 113 | 6 | ▶ | sub _fh_has_encoding { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
_fh_has_encoding: called CC=2 SCAR=8.1
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 114 | 6 | my $fh = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 115 | return !!( | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 116 | 6 | ▶ | defined &PerlIO::get_layers | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
defined &PerlIO::get_layers && grep(($_ eq 'utf8'), &PerlIO::get_layers($fh))
MC/DC0%0/2
defined &PerlIO::get_layers && grep(($_ eq 'utf8'), &PerlIO::get_layers($fh))
defined &PerlIO::get_layers
grep(($_ eq 'utf8'), &PerlIO::get_layers($fh))
Truth table33%1/3
A && B
A= defined &PerlIO::get_layersB= grep(($_ eq 'utf8'), &PerlIO::get_layers($fh))
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 117 | and grep $_ eq 'utf8', PerlIO::get_layers($fh) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 118 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 119 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 120 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 121 | 23 | ▶ | sub pod_coverage_ok { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
pod_coverage_ok: called CC=14 SCAR=26.4
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 122 | 23 | my $module = shift; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 123 | 23 | ▶ | my %opts = ref $_[0] eq 'HASH' ? %{ +shift } : (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 124 | 23 | ▶ | my $msg = shift || "Pod coverage on $module"; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
shift() || "Pod coverage on $module"
MC/DC100%1/1
shift() || "Pod coverage on $module"
shift()
Truth table100%2/2
A
A= shift()
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 125 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 126 | 23 | $opts{package} = $module; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 127 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 128 | 23 | ▶ | my $class = delete $opts{coverage_class} || 'Pod::Coverage::TrustMe'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition100%2/2
delete $opts{'coverage_class'} || 'Pod::Coverage::TrustMe'
MC/DC100%1/1
delete $opts{'coverage_class'} || 'Pod::Coverage::TrustMe'
delete $opts{'coverage_class'}
Truth table100%2/2
A
A= delete $opts{'coverage_class'}
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 129 | 23 | (my $mod = "$class.pm") =~ s{::}{/}g; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 130 | 23 | require $mod; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 132 | 23 | my $cover = $class->new(%opts); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 133 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 134 | 23 | ▶ | our $Test ||= Test::Builder->new; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
our $Test ||= "Test::Builder"->new
MC/DC0%0/2
our $Test ||= "Test::Builder"->new
our $Test
"Test::Builder"->new
Truth table66%2/3
A ||= B
A= our $TestB= "Test::Builder"->new
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 135 | 23 | local $Test::Builder::Level = $Test::Builder::Level + 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 136 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 137 | 23 | my $ok; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 138 | my $extra; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 139 | 23 | my $rating = $cover->coverage; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 140 | 23 | ▶ | if (!defined $rating) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 141 | 3 | my $why = $cover->why_unrated; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 142 | my $symbols | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 143 | = $cover->can('symbols') ? $cover->symbols | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 144 | 3 | ▶ | : do { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 145 | # shim for using with Pod::Coverage subclasses rather than TrustMe | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 146 | 2 | my @symbs = $cover->_get_syms($module); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 147 | 2 | ▶ | $cover->why_unrated =~ /\Arequiring .* failed\z/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 148 | ? undef : { map +($_ => 1), @symbs }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 149 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 150 | 3 | ▶ | $ok = $Test->ok( defined $symbols && !%$symbols, $msg ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
defined $symbols && !%$symbols
MC/DC50%1/2
defined $symbols && !%$symbols
defined $symbols
!%$symbols
Truth table66%2/3
A && not(B)
A= defined $symbolsB= !%$symbols
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 151 | 3 | $extra = "$module: $why"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 152 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 153 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 154 | 20 | $ok = $Test->is_eq((map sprintf('%3.0f%%', $_ * 100), $rating, 1), $msg); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 155 | 20 | ▶ | if (!$ok) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 156 | 3 | $extra = join('', | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 157 | "Naked subroutines:\n", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 158 | map " $_\n", sort $cover->uncovered, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 159 | ); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 160 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 161 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 162 | 23 | ▶ | if (defined $extra) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 163 | 6 | ▶ | my $fh = $ok ? $Test->output : $Test->_diag_fh; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 164 | 6 | ▶ | if (!_fh_has_encoding($fh)) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 165 | 6 | utf8::encode($extra); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 166 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 167 | 6 | ▶ | if ($ok) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 168 | 2 | $Test->note( $extra ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 169 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 170 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 171 | 4 | $Test->diag( $extra ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 172 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 174 | 23 | return $ok; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 175 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 176 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 177 | 1 | ▶ | sub all_pod_coverage_ok { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
all_pod_coverage_ok: called CC=7 SCAR=22.0
Pod
documented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 178 | 0 | ▶ | my %opts = ref $_[0] eq 'HASH' ? %{ +shift } : (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 179 | 1 | my $dirs = delete $opts{dirs}; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 180 | 1 | ▶ | my @modules = all_modules(@{ $dirs || [] }); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition50%1/2
$dirs || []
MC/DC0%0/1
$dirs || []
$dirs
Truth table50%1/2
A
A= $dirs
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 181 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 182 | 1 | ▶ | our $Test ||= Test::Builder->new; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
our $Test ||= "Test::Builder"->new
MC/DC0%0/2
our $Test ||= "Test::Builder"->new
our $Test
"Test::Builder"->new
Truth table33%1/3
A ||= B
A= our $TestB= "Test::Builder"->new
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 183 | 1 | local $Test::Builder::Level = $Test::Builder::Level + 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 184 | 1 | my $ok = 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 185 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 186 | 1 | ▶ | if ( @modules ) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 187 | 1 | $Test->plan( tests => scalar @modules ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 188 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 189 | 1 | for my $module ( @modules ) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 190 | 3 | ▶ | pod_coverage_ok( $module, \%opts, @_ ) or $ok = 0; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 191 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 192 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 193 | else { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 194 | 0 | $Test->plan( tests => 1 ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 195 | 0 | $Test->ok( 1, "No modules found." ); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 196 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 197 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 198 | 1 | return $ok; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 199 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 200 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 201 | 14 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 202 | __END__ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||