Reading database from ...
------------------------------------------ ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------------------------------ ------ ------ ------ ------ ------
tests/cond_and 96.3 50.0 50.0 100.0 75.9
Total 96.3 50.0 50.0 100.0 75.9
------------------------------------------ ------ ------ ------ ------ ------
Run: ...
Perl version: ...
OS: ...
Start: ...
Finish: ...
tests/cond_and
line err stmt bran cond sub code
1 #!/usr/bin/perl
2
3 # Copyright 2002-2014, Paul Johnson (paul@pjcj.net)
4
5 # This software is free. It is licensed under the same terms as Perl itself.
6
7 # The latest version of this software should be available from my homepage:
8 # http://www.pjcj.net
9
10 1 1 use strict;
1
1
11 1 1 use warnings;
1
1
12
13 1 my @x;
14
15 1 my $y = 1;
16 1 my $z = 0;
17
18 1 for (0 .. 10) {
11
19 *** 11 50 $y &&
20 $x[1]++;
21
22 *** 11 100 66 $y &&
23 $x[0]++ &&
24 $x[1]++;
25
26 *** 11 50 $x[2]++
27 if $z;
28
29 11 for (0 .. 2) {
33
30 33 $x[3]++;
31 }
32
33 *** 11 50 if ($y) {
34 11 $x[4]++;
35 } else {
36 *** 0 0 $y && $x[5]++;
37 }
38
39 11 my $p = $y & $z;
40
41 *** 11 33 $p &&= $y;
42 *** 11 33 $p &&= $z;
43 11 my $q = 1;
44 *** 11 66 $q &&= $_;
45
46 11 pas();
47 }
48
49 sub pas {
50 *** 11 50 11 $y && $z
51 }
52
53 # print join(", ", @x), "\n";
Branches
--------
line err % true false branch
----- --- ------ ------ ------ ------
19 *** 50 11 0 if $y
22 100 10 1 if $y and $x[0]++
26 *** 50 0 11 if $z
33 *** 50 11 0 if ($y) { }
36 *** 0 0 0 if $y
50 *** 50 11 0 if $y
Conditions
----------
and 3 conditions
line err % !l l&&!r l&&r expr
----- --- ------ ------ ------ ------ ----
22 *** 66 0 1 10 $y and $x[0]++
41 *** 33 11 0 0 $p &&= $y
42 *** 33 11 0 0 $p &&= $z
44 *** 66 0 1 10 $q &&= $_
Covered Subroutines
-------------------
Subroutine Count Location
---------- ----- -----------------
BEGIN 1 tests/cond_and:10
BEGIN 1 tests/cond_and:11
pas 11 tests/cond_and:50