blib/lib/Config/Model/TypeConstraints.pm

filter: Statementstmt 100% 16 / 16 Branchbran 75.0% 3 / 4 Conditioncond 50.0% 3 / 6 MC/DCmcdc 25.0% 1 / 4 Subroutinesub 100% 5 / 5 Podpod n/a totaltotal 80.0% 28 / 35 CC 5 SCAR 12.7
CC
5
Cov
85%
__ANON__
5.6
BEGIN
1.0
BEGIN
1.0
CRAP 3.5
« blib/lib/Config/Model/Backend/ShellVar.pm ↑ Summary blib/lib/Config/Model/Role/WarpMaster.pm »
1 #
2 # This file is part of Config-Model
3 #
4 # This software is Copyright (c) 2005-2022 by Dominique Dumont.
5 #
6 # This is free software, licensed under:
7 #
8 # The GNU Lesser General Public License, Version 2.1, February 1999
9 #
10 package Config::Model::TypeConstraints 2.169;
11  
12 59 ▶use Mouse;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 59 ▶use Mouse::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 # used only for tests
16 59 my $__test_home = '';
17 13 ▶sub _set_test_home { return $__test_home = shift; }
Subroutine _set_test_home: called CC=1 SCAR=0.0
18 4 ▶sub _get_test_home { return $__test_home ; }
Subroutine _get_test_home: called CC=1 SCAR=0.0
19  
20 59 subtype 'Config::Model::TypeContraints::Path' => as 'Maybe[Path::Tiny]' ;
21 51 ▶coerce 'Config::Model::TypeContraints::Path' => from 'Str' => via sub {
Subroutine __ANON__: called CC=5 SCAR=17.2
22 51 ▶ if (defined $_ and /^~/) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $_ and /^~/) 1 50 51
Condition66%2/3
defined $_ and /^~/
!ll&&!rl&&r
0501
MC/DC50%1/2
defined $_ and /^~/
defined $_ /^~/
Truth table66%2/3
A and B
A= defined $_B= /^~/
ABresult
0X0
100
111
23 # because of tests, we can't rely on Path::Tiny's tilde processing
24 1 ▶ my $home = $__test_home || File::HomeDir->my_home;
Condition33%1/3
$__test_home || 'File::HomeDir'->my_home
l!l&&r!l&&!r
100
MC/DC0%0/2
$__test_home || 'File::HomeDir'->my_home
$__test_home 'File::HomeDir'->my_home
Truth table33%1/3
A || B
A= $__test_homeB= 'File::HomeDir'->my_home
ABresult
1X1
011
000
25 1 s/^~/$home/;
26 }
27 51 ▶ return defined $_ ? Path::Tiny::path($_) : undef ;
Branch: 1 branch
BranchTrueFalseTotal
defined $_ ? : 51 0 51
28 59 } ;
29  
30 59 1;
31  
32 # ABSTRACT: Mouse type constraints for Config::Model
33  
34 __END__
« blib/lib/Config/Model/Backend/ShellVar.pm ↑ Summary blib/lib/Config/Model/Role/WarpMaster.pm »