blib/lib/Mojo/Cache/Role/Strict.pm

filter: Statementstmt 100% 14 / 14 Branchbran 100% 4 / 4 Conditioncond 100% 3 / 3 MC/DCmcdc 100% 2 / 2 Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 100% 27 / 27 SCAR 13.9
CC
4
Cov
100%
__ANON__
3.0
__ANON__
2.0
BEGIN
1.0
CRAP 4.0
↑ Summary Build »
1 package Mojo::Cache::Role::Strict;
2 3 ▶use Mojo::Base -role;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 3 ▶use Carp ();
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 3 with 'Mojo::Cache::Role::Exists';
6  
7 3 our $VERSION = '0.04';
8  
9 3 has [qw(strict_get strict_set)] => 1;
10  
11 before get => sub {
12 13 ▶ Carp::confess qq{unknown key '$_[1]'} if $_[0]->strict_get and not $_[0]->exists($_[1]);
Subroutine __ANON__: called CC=3 SCAR=11.0
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->strict_get and not $_[0]->exists($_[1]) 4 9 13
Condition100%3/3
$_[0]->strict_get and not $_[0]->exists($_[1])
!ll&&!rl&&r
364
MC/DC100%2/2
$_[0]->strict_get and not $_[0]->exists($_[1])
$_[0]->strict_get not $_[0]->exists($_[1])
Truth table100%3/3
A and not(B)
A= $_[0]->strict_getB= not $_[0]->exists($_[1])
ABresult
0X0
100
111
13 3 };
14  
15 before set => sub {
16 6 ▶ Carp::confess 'cannot set in strict_set mode' if $_[0]->strict_set;
Subroutine __ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
BranchTrueFalseTotal
if $_[0]->strict_set 4 2 6
17 3 };
18  
19 3 1;
20 __END__
↑ Summary Build »