t/test62-subcaller1-b.p

filter: Statementstmt 94.1% 16 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 75.0% 3 / 4 Podpod n/a totaltotal 90.4% 19 / 21 CC 1 SCAR 2.2
CC
1
Cov
94%
sub3
2.0
sub1
1.0
sub2
1.0
CRAP 1.2
« blib/lib/Devel/NYTProf.pm ↑ Summary t/test51-enable.p »
1 # test determination of subroutine caller in unusual cases
2  
3 # test dying from an xsub
4 16 require Devel::NYTProf::Test;
5 16 eval { Devel::NYTProf::Test::example_xsub(0, "die") };
6  
7 # test dying from an xsub where the surrounding eval is an
8 # argument to a sub call. This used to coredump.
9 16 ▶sub sub1 { $_[0] }
Subroutine sub1: called CC=1 SCAR=0.0
10 16 sub1 eval { Devel::NYTProf::Test::example_xsub(0, "die") };
11  
12 # test sub calls (xs and perl) from within a sort block
13 96 ▶sub sub2 { $_[0] }
Subroutine sub2: called CC=1 SCAR=0.0
14 # sort block on one line due to change to line numbering in perl 5.21
15 16 my @a = sort { Devel::NYTProf::Test::example_xsub(); sub2($a) <=> sub2($b); } (1,3,2);
16  
17 # test sub call as a sort block
18 0 ▶sub sub3 { $_[0] } # XXX not recorded due to limitation of perl
Subroutine sub3: not called CC=1 SCAR=6.9
19 16 my @b = sort \&sub3, 3, 1, 2;
20  
21 # test sub call from a subst
22 32 ▶sub sub4 { $_[0] }
Subroutine sub4: called CC=1 SCAR=0.0
23 16 my $a = "abcbd";
24 16 $a =~ s/b/sub4(uc($1))/ge;
25  
26 16 exit 0;
« blib/lib/Devel/NYTProf.pm ↑ Summary t/test51-enable.p »