Reading database from /home/pjcj/g/perl/dev/Devel-Cover-0.3209/cover_db
------------------------------------------ ------ ------ ------ ------ ------
File stmt branch cond sub total
------------------------------------------ ------ ------ ------ ------ ------
tests/if 78.57 50.00 n/a n/a 66.67
Total 78.57 50.00 n/a n/a 66.67
------------------------------------------ ------ ------ ------ ------ ------
tests/if
line err stmt branch cond sub code
1 #!/usr/bin/perl
2
3 # Copyright 2004, Paul Johnson (pjcj@cpan.org)
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 use strict;
11 use warnings;
12
13 1 my ($x, $p, $q, $r, $s);
14
15 1 $x = 0;
16
17 *** 1 50 if ($x)
18 {
19 *** 0 $p++
20 }
21
22 *** 1 50 unless ($x)
23 {
24 1 $q++
25 }
26
27 1 $x = 1;
28
29 *** 1 50 if ($x)
30 {
31 1 $r++
32 }
33
34 *** 1 50 if ($x)
35 {
36 1 $r++
37 }
38 else
39 {
40 *** 0 $s++
41 }
42
43 *** 1 50 unless ($x)
44 {
45 *** 0 $s++
46 }
Branches
--------
line err % true false branch
----- --- ------ ------ ------ ------
17 *** 50 0 1 if ($x)
22 *** 50 1 0 unless ($x)
29 *** 50 1 0 if ($x)
34 *** 50 1 0 if ($x) { }
43 *** 50 0 1 unless ($x)