t/ipc_opens_utils_testing.perl

filter: Statementstmt 100% 16 / 16 Branchbran 100% 2 / 2 Conditioncond 100% 6 / 6 MC/DCmcdc 100% 3 / 3 Subroutinesub n/a Podpod n/a totaltotal 100% 27 / 27 CC 0 SCAR 0
CC
0
Cov
0%
CRAP 0
« lib/IPC/Open3/Utils.pm ↑ Summary
1
2 16 require Time::HiRes;
3  
4 16 my ($n,$e,$p) = @ARGV;
5 16 ▶$n = abs(int($n)) || 1;
Condition100%2/2
abs int $n || 1
l!l
412
MC/DC100%1/1
abs int $n || 1
abs int $n
Truth table100%2/2
A
A= abs int $n
Aresult
11
00
6 16 ▶$e = abs(int($e)) || 0;
Condition100%2/2
abs int $e || 0
l!l
313
MC/DC100%1/1
abs int $e || 0
abs int $e
Truth table100%2/2
A
A= abs int $e
Aresult
11
00
7 16 ▶$p = abs(int($p)) || 0;
Condition100%2/2
abs int $p || 0
l!l
115
MC/DC100%1/1
abs int $p || 0
abs int $p
Truth table100%2/2
A
A= abs int $p
Aresult
11
00
8  
9 16 ▶if ($p) {
Branch: 1 branch
BranchTrueFalseTotal
if ($p) 1 15 16
10 1 $|++;
11 1 print "What number:\n";
12 1 my $num = <STDIN>;
13 1 $num =~ s{\D+}{};
14 1 print "You said -$num-\n";
15 }
16  
17 16 for (1 .. $n) {
18 16 print "expected stdout\n";
19 16 Time::HiRes::nanosleep(10_000); # handle oddity in timing in tests on some systems
20 16 print STDERR "expected stderr\n"
21 }
22  
23 16 exit($e);
« lib/IPC/Open3/Utils.pm ↑ Summary