/
t0.5.008001
81 lines (67 loc) · 3.27 KB
/
t0.5.008001
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Reading database from /home/pjcj/g/perl/dev/Devel-Cover-0.3409/cover_db
------------------------------------------ ------ ------ ------ ------ ------
File stmt branch cond sub total
------------------------------------------ ------ ------ ------ ------ ------
tests/t0 90.91 62.50 66.67 n/a 77.27
Total 90.91 62.50 66.67 n/a 77.27
------------------------------------------ ------ ------ ------ ------ ------
tests/t0
line err stmt branch cond sub code
1 #!/usr/bin/perl
2
3 # Copyright 2002-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;
14
15 1 my $y = 1;
16
17 1 for (0 .. 10)
18 {
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 $y;
28
29 11 for (0 .. 2)
30 {
31 33 $x[3]++;
32 }
33
34 *** 11 50 if ($y)
35 {
36 11 $x[4]++;
37 }
38 else
39 {
40 *** 0 $x[5]++;
41 }
42 }
43
44 # 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 11 0 if $y
34 *** 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]++