assign/Test.pm

filter: Statementstmt 100% 42 / 42 Branchbran 50.0% 4 / 8 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 12 / 12 Podpod 0.0% 0 / 2 totaltotal 85.5% 59 / 69 CC 5 SCAR 6.7
CC
5
Cov
89%
test
4.3
END
2.1
BEGIN
1.0
CRAP 2.0
« assign.pm ↑ Summary assign/Types.pm »
1 5 ▶use strict; use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
2 package
3 assign::Test;
4 5 ▶use XXX;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 5 ▶use assign::0;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 5 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 5 ▶use Capture::Tiny;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 5 ▶use XXX;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 5 ▶use base 'Exporter';
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 5 ▶our $t = -d 't' ? 't' : 'test';
Branch: 1 branch
BranchTrueFalseTotal
-d 't' ? : 5 0 5
14  
15 5 our @EXPORT = qw(
16 $t
17 test
18 is ok pass fail like
19 capture
20 XXX
21 WWW
22 );
23  
24 5 ▶sub import {
Subroutine import: called CC=1 SCAR=0.0
25 5 strict->import;
26 5 warnings->import;
27 5 goto &Exporter::import;
28 }
29  
30 5 my $test_count = 0;
31 15 ▶sub test {
Subroutine test: called CC=4 SCAR=14.6
Pod undocumented
32 return if
33 defined $ENV{ONLY} and
34 15 ▶ $ENV{ONLY} != ++$test_count;
Branch: 1 branch
BranchTrueFalseTotal
if defined $ENV{"ONLY"} and $ENV{"ONLY"} != ++$test_count 0 15 15
Condition33%1/3
defined $ENV{"ONLY"} and $ENV{"ONLY"} != ++$test_count
!ll&&!rl&&r
1500
MC/DC0%0/2
defined $ENV{"ONLY"} and $ENV{"ONLY"} != ++$test_count
defined $ENV{"ONLY"} $ENV{"ONLY"} != ++$test_count
Truth table33%1/3
A and B
A= defined $ENV{"ONLY"}B= $ENV{"ONLY"} != ++$test_count
ABresult
0X0
100
111
35  
36 15 $assign::0::var_prefix = '_';
37 15 $assign::0::var_id = 0;
38  
39 15 my ($spec, $label) = @_;
40  
41 15 ▶ $spec =~ /(.*\n)\+\+\+\n(.*)/s
Branch: 1 branch
BranchTrueFalseTotal
$spec =~ /(.*\n)\+\+\+\n(.*)/s or die "Invalid spec for 'test()'" 15 0 15
42 or die "Invalid spec for 'test()'";
43 15 my ($perl, $want) = ($1, $2);
44  
45 15 my $got = assign::0->new(code => $perl)->transform;
46  
47 15 is $got, $want, $label;
48 }
49  
50 1 ▶sub capture { goto &Capture::Tiny::capture_merged }
Subroutine capture: called CC=1 SCAR=0.0
Pod undocumented
51  
52 5 ▶END {
Subroutine END: called CC=2 SCAR=7.2
53 package main;
54  
55 5 ▶ if (not defined $ENV{PERL_ZILD_TEST_000_COMPILE_MODULES}) {
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $ENV{"PERL_ZILD_TEST_000_COMPILE_MODULES"}) 5 0 5
56 5 Test::More::done_testing();
57 }
58 }
59  
60 5 1;
« assign.pm ↑ Summary assign/Types.pm »