Merge branch 'GH-323-uncoverable-error'
Paul Johnson
1 year, 7 days ago
67 | 67 | qw( |
68 | 68 | add_uncoverable_point=s |
69 | 69 | annotation=s |
70 | gcov_chdir! | |
71 | 70 | clean_uncoverable_points! |
72 | 71 | coverage=s |
73 | 72 | delete! |
74 | 73 | delete_uncoverable_point=s |
75 | 74 | dump_db! |
76 | 75 | gcov! |
76 | gcov_chdir! | |
77 | 77 | help|h! |
78 | ignore=s | |
79 | ignore_covered_err! | |
78 | 80 | ignore_re=s |
79 | ignore=s | |
80 | 81 | info|i! |
81 | 82 | launch! |
82 | 83 | make=s |
83 | 84 | outputdir=s |
84 | 85 | prefer_lib! |
85 | 86 | relative_only! |
87 | report=s | |
86 | 88 | report_c0=s |
87 | 89 | report_c1=s |
88 | 90 | report_c2=s |
89 | report=s | |
91 | select=s | |
90 | 92 | select_re=s |
91 | select=s | |
92 | 93 | silent! |
93 | 94 | summary! |
94 | 95 | test! |
196 | 197 | |
197 | 198 | get_options; |
198 | 199 | |
199 | $Devel::Cover::Silent = 1 if $Options->{silent}; | |
200 | $Devel::Cover::Silent = 1 if $Options->{silent}; | |
201 | $Devel::Cover::Ignore_covered_err = 1 if $Options->{ignore_covered_err}; | |
200 | 202 | |
201 | 203 | $Options->{report} = [ grep { |
202 | 204 | my $report = $_; |
507 | 509 | -gcov - run gcov to cover XS code (default on if using gcc) |
508 | 510 | -make make_prog - use the given 'make' program for 'make test' |
509 | 511 | -prefer_lib - prefer files in lib (default off) |
512 | -ignore_covered_err - allow coverung uncoverable code (default off) | |
510 | 513 | |
511 | 514 | -add_uncoverable_point string |
512 | 515 | -delete_uncoverable_point string |
614 | 617 | The C<-prefer_lib> option tells Devel::Cover to report on files in the lib |
615 | 618 | directory even if they were used from the blib directory. |
616 | 619 | |
620 | The C<-ignore_covered_err> option will not flag an error if uncoverable code is | |
621 | covered. | |
622 | ||
617 | 623 | =head1 EXIT STATUS |
618 | 624 | |
619 | 625 | The following exit values are returned: |
23 | 23 | sub text { $_[0][1]{text} } |
24 | 24 | sub criterion { "branch" } |
25 | 25 | |
26 | ||
27 | 26 | sub percentage { |
28 | 27 | my $t = $_[0]->total; |
29 | 28 | sprintf "%3d", $t ? $_[0]->covered / $t * 100 : 0 |
33 | 32 | my $self = shift; |
34 | 33 | if (@_) { |
35 | 34 | my $c = shift; |
36 | return !($self->covered($c) xor $self->uncoverable($c)); | |
35 | return $self->err_chk($self->covered($c), $self->uncoverable($c)); | |
37 | 36 | } |
38 | 37 | my $e = 0; |
39 | 38 | for my $c (0 .. $#{$self->[0]}) { |
40 | $e++ if !($self->covered($c) xor $self->uncoverable($c)); | |
39 | $e++ if $self->err_chk($self->covered($c), $self->uncoverable($c)); | |
41 | 40 | } |
42 | 41 | $e |
43 | 42 | } |
36 | 36 | sub criterion { require Carp; |
37 | 37 | Carp::confess("criterion() must be overridden") } |
38 | 38 | |
39 | sub err_chk { | |
40 | my $self = shift; | |
41 | my ($covered, $uncoverable) = @_; | |
42 | no warnings qw( once uninitialized ); | |
43 | $Devel::Cover::Ignore_covered_err || $uncoverable eq "ignore_covered_err" | |
44 | ? !($covered || $uncoverable) | |
45 | : !($covered xor $uncoverable) | |
46 | } | |
47 | ||
48 | sub simple_error { | |
49 | my $self = shift; | |
50 | $self->err_chk($self->covered, $self->uncoverable) | |
51 | } | |
52 | ||
39 | 53 | sub calculate_percentage { |
40 | 54 | my $class = shift; |
41 | 55 | my ($db, $s) = @_; |
64 | 78 | $self->aggregate($s, $file, "covered", 1) if $self->covered; |
65 | 79 | $self->aggregate($s, $file, "error", 1) if $self->error; |
66 | 80 | } |
67 | ||
68 | 81 | |
69 | 82 | 1 |
70 | 83 |
36 | 36 | my ($db, $s) = @_; |
37 | 37 | |
38 | 38 | # print STDERR Dumper $s; |
39 | ||
40 | 39 | for my $criterion ($self->items) { |
41 | 40 | next unless exists $s->{$criterion}; |
42 | 41 | my $c = "Devel::Cover::\u$criterion"; |
44 | 43 | $c->calculate_percentage($db, $s->{$criterion}); |
45 | 44 | } |
46 | 45 | Devel::Cover::Criterion->calculate_percentage($db, $s->{total}); |
47 | ||
48 | 46 | # print STDERR Dumper $s; |
49 | 47 | } |
50 | 48 |
19 | 19 | sub covered { $_[0][0] ? 1 : 0 } |
20 | 20 | sub total { 1 } |
21 | 21 | sub percentage { $_[0][0] ? 100 : 0 } |
22 | sub error { $_[0][0] xor !$_[0][2] } | |
22 | sub error { $_[0]->simple_error } | |
23 | 23 | sub criterion { "pod" } |
24 | 24 | |
25 | 25 | sub calculate_summary { |
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
77 | # use Devel::Cover::Dumper; print STDERR Dumper(\%criteria); | |
77 | 78 | my $more = 1; |
78 | 79 | while ($more) { |
79 | 80 | my @args = ($n, ""); |
98 | 99 | : $o->percentage |
99 | 100 | : ""; |
100 | 101 | $value = "-" . $value if $o && $o->uncoverable; |
102 | $value = "*" . $value if $o && $o->error; | |
101 | 103 | push @args, $value; |
102 | 104 | $error ||= $o->error if $o; |
103 | 105 | } |
13 | 13 | |
14 | 14 | use base "Devel::Cover::Criterion"; |
15 | 15 | |
16 | sub val { $_[0][0] } | |
17 | sub uncoverable { $_[0][1] } | |
18 | sub covered { $_[0][0] } | |
19 | sub total { 1 } | |
20 | sub percentage { $_[0][0] ? 100 : 0 } | |
21 | sub error { $_[0][0] xor !$_[0][1] } | |
22 | sub criterion { "statement" } | |
23 | ||
16 | sub val { $_[0][0] } | |
17 | sub uncoverable { $_[0][1] } | |
18 | sub covered { $_[0][0] } | |
19 | sub total { 1 } | |
20 | sub percentage { $_[0][0] ? 100 : 0 } | |
21 | sub error { $_[0]->simple_error } | |
22 | sub criterion { "statement" } | |
24 | 23 | |
25 | 24 | 1 |
26 | 25 |
17 | 17 | sub covered { $_[0][0] } |
18 | 18 | sub total { 1 } |
19 | 19 | sub percentage { $_[0][0] ? 100 : 0 } |
20 | sub error { $_[0][0] xor !$_[0][2] } | |
20 | sub error { $_[0]->simple_error } | |
21 | 21 | sub name { $_[0][1] } |
22 | 22 | sub criterion { "subroutine" } |
23 | 23 |
87 | 87 | unless (mkdir $self->{cover_db}) { |
88 | 88 | die "Can't mkdir $self->{cover_db}: $!" unless -d $self->{cover_db}; |
89 | 89 | } |
90 | my $p = $self->{cover_parameters} || []; | |
90 | 91 | $self->{cover_parameters} = join(" ", map "-coverage $_", |
91 | 92 | split " ", $self->{criteria}) |
92 | . " -report text " | |
93 | . " @$p -report text " | |
93 | 94 | . shell_quote $self->{cover_db}; |
94 | 95 | $self->{cover_parameters} .= " -uncoverable_file " |
95 | 96 | . "@{$self->{uncoverable_file}}" |
101 | 101 | # Used in runops function |
102 | 102 | our $Replace_ops; # Whether we are replacing ops |
103 | 103 | our $Silent; # Output nothing. Can be used anywhere |
104 | our $Ignore_covered_err; # Don't flag an error when uncoverable | |
105 | # code is covered. | |
104 | 106 | our $Self_cover; # Coverage of Devel::Cover |
105 | 107 | |
106 | 108 | BEGIN { |
314 | 316 | /^-blib/ && do { $blib = shift @o; next }; |
315 | 317 | /^-subs_only/ && do { $Subs_only = shift @o; next }; |
316 | 318 | /^-replace_ops/ && do { $Replace_ops = shift @o; next }; |
317 | /^-coverage/ && | |
319 | /^-coverage/ && | |
318 | 320 | do { $Coverage{+shift @o} = 1 while @o && $o[0] !~ /^[-+]/; next }; |
319 | /^[-+]ignore/ && | |
321 | /^[-+]ignore/ && | |
320 | 322 | do { push @Ignore, shift @o while @o && $o[0] !~ /^[-+]/; next }; |
321 | /^[-+]inc/ && | |
323 | /^[-+]inc/ && | |
322 | 324 | do { push @Inc, shift @o while @o && $o[0] !~ /^[-+]/; next }; |
323 | /^[-+]select/ && | |
325 | /^[-+]select/ && | |
324 | 326 | do { push @Select, shift @o while @o && $o[0] !~ /^[-+]/; next }; |
325 | 327 | warn __PACKAGE__ . ": Unknown option $_ ignored\n"; |
326 | 328 | } |
1588 | 1590 | may then be further information depending on the nature of the uncoverable |
1589 | 1591 | construct. |
1590 | 1592 | |
1593 | In all cases as L<class> attribute may be included in L<details>. At present a | |
1594 | single class attribute is recognised: L<ignore_covered_err>. Normally, an | |
1595 | error is flagged if code marked as L<uncoverable> is covered. When the | |
1596 | L<ignore_covered_err> attribute is specified then such errors will not be | |
1597 | flagged. This is a more precise method to flag such exceptions than the global | |
1598 | L<-ignore_covered_err> flag to the L<cover> program. | |
1599 | ||
1600 | There is also a L<note> attribute which can also be included in L<details>. | |
1601 | This should be the final attribute and will consude all the remaining text. | |
1602 | Currently this attribute is not used, but it is intented as a form of | |
1603 | documentation for the uncoverable data. | |
1604 | ||
1605 | Example: | |
1606 | ||
1607 | # uncoverable branch true count:1..3 class:ignore_covered_err note:error chk | |
1608 | ||
1591 | 1609 | =head3 Statements |
1592 | 1610 | |
1593 | 1611 | The "uncoverable" comment should appear on either the same line as the |
29 | 29 | 10 1 my $x = 1; |
30 | 30 | 11 1 my $y = 1; |
31 | 31 | 12 |
32 | 13 *** 1 50 33 if ($x && !$y) { | |
33 | 14 *** 0 die "Urgh"; | |
32 | 13 *** 1 * 50 * 33 if ($x && !$y) { | |
33 | 14 *** *0 die "Urgh"; | |
34 | 34 | 15 } |
35 | 35 | 16 |
36 | 17 *** 1 50 33 if ($x && $y) { | |
36 | 17 *** 1 * 50 * 33 if ($x && $y) { | |
37 | 37 | 18 } |
38 | 38 | 19 |
39 | 20 *** 1 50 33 unless ($x && $y) { | |
40 | 21 *** 0 die "Urgh"; | |
39 | 20 *** 1 * 50 * 33 unless ($x && $y) { | |
40 | 21 *** *0 die "Urgh"; | |
41 | 41 | 22 } |
42 | 42 | 23 |
43 | 24 *** 1 50 33 if (!($x && $y)) { | |
44 | 25 *** 0 die "Urgh"; | |
43 | 24 *** 1 * 50 * 33 if (!($x && $y)) { | |
44 | 25 *** *0 die "Urgh"; | |
45 | 45 | 26 } |
46 | 46 | 27 |
47 | 28 *** 1 50 33 if (!$x || !$y) { | |
48 | 29 *** 0 die "Urgh"; | |
47 | 28 *** 1 * 50 * 33 if (!$x || !$y) { | |
48 | 29 *** *0 die "Urgh"; | |
49 | 49 | 30 } |
50 | 50 | |
51 | 51 |
41 | 41 | 1 |
42 | 42 | 17 |
43 | 43 | 18 1 my $x = 1; |
44 | 19 *** 1 50 print $x if 1 >= $x; | |
44 | 19 *** 1 * 50 print $x if 1 >= $x; | |
45 | 45 | |
46 | 46 | |
47 | 47 | Branches |
26 | 26 | 1 |
27 | 27 | 6 |
28 | 28 | 7 sub f { |
29 | 8 *** 0 0 0 return MyType if @_; | |
29 | 8 *** *0 * 0 *0 return MyType if @_; | |
30 | 30 | 9 } |
31 | 31 | |
32 | 32 |
39 | 39 | 16 1 my $z = 0; |
40 | 40 | 17 |
41 | 41 | 18 1 for (0 .. 10) { |
42 | 19 *** 11 50 $y && | |
42 | 19 *** 11 * 50 $y && | |
43 | 43 | 20 $x[1]++; |
44 | 44 | 21 |
45 | 22 *** 11 100 66 $y && | |
45 | 22 *** 11 100 * 66 $y && | |
46 | 46 | 23 $x[0]++ && |
47 | 47 | 24 $x[1]++; |
48 | 48 | 25 |
49 | 26 *** 11 50 $x[2]++ | |
49 | 26 *** 11 * 50 $x[2]++ | |
50 | 50 | 27 if $z; |
51 | 51 | 28 |
52 | 52 | 29 11 for (0 .. 2) { |
53 | 53 | 30 33 $x[3]++; |
54 | 54 | 31 } |
55 | 55 | 32 |
56 | 33 *** 11 50 if ($y) { | |
56 | 33 *** 11 * 50 if ($y) { | |
57 | 57 | 34 11 $x[4]++; |
58 | 58 | 35 } else { |
59 | 36 *** 0 0 $y && $x[5]++; | |
59 | 36 *** *0 * 0 $y && $x[5]++; | |
60 | 60 | 37 } |
61 | 61 | 38 |
62 | 62 | 39 11 my $p = $y & $z; |
63 | 63 | 40 |
64 | 41 *** 11 33 $p &&= $y; | |
65 | 42 *** 11 33 $p &&= $z; | |
64 | 41 *** 11 * 33 $p &&= $y; | |
65 | 42 *** 11 * 33 $p &&= $z; | |
66 | 66 | 43 11 my $q = 1; |
67 | 44 *** 11 66 $q &&= $_; | |
67 | 44 *** 11 * 66 $q &&= $_; | |
68 | 68 | 45 |
69 | 69 | 46 11 pas(); |
70 | 70 | 47 } |
71 | 71 | 48 |
72 | 72 | 49 sub pas { |
73 | 50 *** 11 50 11 $y && $z | |
73 | 50 *** 11 * 50 11 $y && $z | |
74 | 74 | 51 } |
75 | 75 | 52 |
76 | 76 | 53 # print join(", ", @x), "\n"; |
37 | 37 | 14 |
38 | 38 | 15 1 for my $y (0, 0) { |
39 | 39 | 16 2 for my $z (1, 0) { |
40 | 17 *** 4 50 33 if ($y && $z) { | |
41 | 18 *** 0 $x[1]++; | |
40 | 17 *** 4 * 50 * 33 if ($y && $z) { | |
41 | 18 *** *0 $x[1]++; | |
42 | 42 | 19 } else { |
43 | 43 | 20 4 $x[2]++; |
44 | 44 | 21 } |
45 | 22 *** 4 100 66 if ($y || $z) { | |
45 | 22 *** 4 100 * 66 if ($y || $z) { | |
46 | 46 | 23 2 $x[3]++; |
47 | 47 | 24 } else { |
48 | 48 | 25 2 $x[4]++; |
49 | 49 | 26 } |
50 | 50 | 27 |
51 | 28 *** 4 50 $y && $x[5]++; | |
52 | 29 *** 4 50 $x[5]++ if $y; | |
51 | 28 *** 4 * 50 $y && $x[5]++; | |
52 | 29 *** 4 * 50 $x[5]++ if $y; | |
53 | 53 | 30 |
54 | 54 | 31 4 100 $z && $x[6]++; |
55 | 55 | 32 4 100 $x[6]++ if $z; |
56 | 56 | 33 |
57 | 34 *** 4 50 $y || $x[7]++; | |
58 | 35 *** 4 50 $x[7]++ unless $y; | |
57 | 34 *** 4 * 50 $y || $x[7]++; | |
58 | 35 *** 4 * 50 $x[7]++ unless $y; | |
59 | 59 | 36 |
60 | 60 | 37 4 100 $z || $x[8]++; |
61 | 61 | 38 4 100 $x[8]++ unless $z; |
62 | 62 | 39 |
63 | 40 *** 4 50 $y ? $x[9]++ : $x[10]++; | |
63 | 40 *** 4 * 50 $y ? $x[9]++ : $x[10]++; | |
64 | 64 | 41 4 100 $z ? $x[11]++ : $x[12]++; |
65 | 65 | 42 |
66 | 43 *** 4 50 33 if ($y) { | |
67 | *** 50 66 | |
66 | 43 *** 4 * 50 * 33 if ($y) { | |
67 | *** * 50 * 66 | |
68 | 68 | 100 |
69 | 44 *** 0 $x[13]++; | |
69 | 44 *** *0 $x[13]++; | |
70 | 70 | 45 } elsif ($y && $z) { |
71 | 46 *** 0 $x[14]++; | |
71 | 46 *** *0 $x[14]++; | |
72 | 72 | 47 } elsif ($y || $z) { |
73 | 73 | 48 2 $x[15]++; |
74 | 74 | 49 } else { |
75 | 75 | 50 2 $x[16]++; |
76 | 76 | 51 } |
77 | 77 | 52 |
78 | 53 *** 4 50 33 $y && $z && $x[17]++; $y && $z && $x[18]++; | |
79 | *** 4 50 33 | |
78 | 53 *** 4 * 50 * 33 $y && $z && $x[17]++; $y && $z && $x[18]++; | |
79 | *** 4 * 50 * 33 | |
80 | 80 | 54 } |
81 | 81 | 55 } |
82 | 82 | 56 |
105 | 105 | 79 1 1 no warnings "void"; |
106 | 106 | 1 |
107 | 107 | 1 |
108 | 80 *** 2 0 my $w = $y xor next; | |
109 | 81 *** 0 $x[22]++; | |
108 | 80 *** 2 * 0 my $w = $y xor next; | |
109 | 81 *** *0 $x[22]++; | |
110 | 110 | 82 } |
111 | 111 | 83 |
112 | 112 | 84 1 for my $y (1, 0) { |
113 | 113 | 85 1 1 no warnings "void"; |
114 | 114 | 1 |
115 | 115 | 1 |
116 | 86 *** 2 0 my $w = $y xor next; | |
117 | 87 *** 0 $x[23]++; | |
116 | 86 *** 2 * 0 my $w = $y xor next; | |
117 | 87 *** *0 $x[23]++; | |
118 | 118 | 88 } |
119 | 119 | 89 |
120 | 120 | 90 |
121 | 121 | 91 1 for my $y (0, 1) { |
122 | 92 *** 1 50 $y || last; | |
123 | 93 *** 0 $x[24]++; | |
122 | 92 *** 1 * 50 $y || last; | |
123 | 93 *** *0 $x[24]++; | |
124 | 124 | 94 } |
125 | 125 | 95 |
126 | 126 | 96 1 for my $y (1, 0) { |
134 | 134 | 104 } |
135 | 135 | 105 |
136 | 136 | 106 1 for my $y (1, 0) { |
137 | 107 *** 1 50 $y && last; | |
138 | 108 *** 0 $x[27]++; | |
137 | 107 *** 1 * 50 $y && last; | |
138 | 108 *** *0 $x[27]++; | |
139 | 139 | 109 } |
140 | 140 | 110 |
141 | 141 | 111 1 for my $y (0, 1) { |
142 | 142 | 112 1 1 no warnings "void"; |
143 | 143 | 1 |
144 | 144 | 1 |
145 | 113 *** 1 0 my $w = $y xor last; | |
146 | 114 *** 0 $x[28]++; | |
145 | 113 *** 1 * 0 my $w = $y xor last; | |
146 | 114 *** *0 $x[28]++; | |
147 | 147 | 115 } |
148 | 148 | 116 |
149 | 149 | 117 1 for my $y (1, 0) { |
150 | 150 | 118 1 1 no warnings "void"; |
151 | 151 | 1 |
152 | 152 | 1 |
153 | 119 *** 1 0 my $w = $y xor last; | |
154 | 120 *** 0 $x[29]++; | |
153 | 119 *** 1 * 0 my $w = $y xor last; | |
154 | 120 *** *0 $x[29]++; | |
155 | 155 | 121 } |
156 | 156 | 122 |
157 | 157 | 123 |
158 | 158 | 124 1 for my $y (0, 1) { |
159 | 125 *** 1 50 $y || goto G1; | |
160 | 126 *** 0 $x[30]++; | |
159 | 125 *** 1 * 50 $y || goto G1; | |
160 | 126 *** *0 $x[30]++; | |
161 | 161 | 127 } |
162 | 162 | 128 G1: |
163 | 163 | 129 |
174 | 174 | 140 G3: |
175 | 175 | 141 |
176 | 176 | 142 1 for my $y (1, 0) { |
177 | 143 *** 1 50 $y && goto G4; | |
178 | 144 *** 0 $x[33]++; | |
177 | 143 *** 1 * 50 $y && goto G4; | |
178 | 144 *** *0 $x[33]++; | |
179 | 179 | 145 } |
180 | 180 | 146 G4: |
181 | 181 | 147 |
183 | 183 | 149 1 1 no warnings "void"; |
184 | 184 | 1 |
185 | 185 | 1 |
186 | 150 *** 1 0 my $w = $y xor goto G5; | |
187 | 151 *** 0 $x[34]++; | |
186 | 150 *** 1 * 0 my $w = $y xor goto G5; | |
187 | 151 *** *0 $x[34]++; | |
188 | 188 | 152 } |
189 | 189 | 153 G5: |
190 | 190 | 154 |
192 | 192 | 156 1 1 no warnings "void"; |
193 | 193 | 1 |
194 | 194 | 1 |
195 | 157 *** 1 0 my $w = $y xor goto G6; | |
196 | 158 *** 0 $x[35]++; | |
195 | 157 *** 1 * 0 my $w = $y xor goto G6; | |
196 | 158 *** *0 $x[35]++; | |
197 | 197 | 159 } |
198 | 198 | 160 G6: |
199 | 199 | 161 |
240 | 240 | 202 1 1 no warnings "void"; |
241 | 241 | 1 |
242 | 242 | 1 |
243 | 203 *** 2 0 my $w = $z xor redo; | |
244 | 204 *** 0 $x[40]++; | |
243 | 203 *** 2 * 0 my $w = $z xor redo; | |
244 | 204 *** *0 $x[40]++; | |
245 | 245 | 205 } |
246 | 246 | 206 |
247 | 247 | 207 1 $z = -1; |
251 | 251 | 211 1 1 no warnings "void"; |
252 | 252 | 1 |
253 | 253 | 1 |
254 | 212 *** 2 0 my $w = !$z xor redo; | |
255 | 213 *** 0 $x[41]++; | |
254 | 212 *** 2 * 0 my $w = !$z xor redo; | |
255 | 213 *** *0 $x[41]++; | |
256 | 256 | 214 } |
257 | 257 | 215 |
258 | 258 | 216 |
271 | 271 | 229 1 1 no warnings "void"; |
272 | 272 | 1 |
273 | 273 | 1 |
274 | 230 *** 4 0 4 shift xor return; | |
275 | 231 *** 0 $x[44]++; | |
274 | 230 *** 4 * 0 4 shift xor return; | |
275 | 231 *** *0 $x[44]++; | |
276 | 276 | 232 }, |
277 | 277 | 233 |
278 | 278 | 234 sub { |
341 | 341 | 296 |
342 | 342 | 297 1 my ($a, $b) = (0, 1); |
343 | 343 | 298 |
344 | 299 *** 1 50 33 if ($a && $b) { | |
345 | *** 50 33 | |
346 | *** 50 50 | |
347 | 300 *** 0 print "path 1\n"; | |
344 | 299 *** 1 * 50 * 33 if ($a && $b) { | |
345 | *** * 50 * 33 | |
346 | *** * 50 * 50 | |
347 | 300 *** *0 print "path 1\n"; | |
348 | 348 | 301 } elsif (!$a && !$b) { |
349 | 302 *** 0 print "path 2\n"; | |
349 | 302 *** *0 print "path 2\n"; | |
350 | 350 | 303 } elsif ($b || 0) { |
351 | 351 | 304 1 print "path 3\n"; |
352 | 305 *** 1 50 33 if (!$b || $a) { | |
353 | *** 50 33 | |
354 | 306 *** 0 print "path 4\n"; | |
352 | 305 *** 1 * 50 * 33 if (!$b || $a) { | |
353 | *** * 50 * 33 | |
354 | 306 *** *0 print "path 4\n"; | |
355 | 355 | 307 } elsif (!$a && $b) { |
356 | 356 | 308 1 print "path 5\n"; |
357 | 357 | 309 } |
37 | 37 | 14 |
38 | 38 | 15 1 for my $y (0, 0) { |
39 | 39 | 16 2 for my $z (1, 0) { |
40 | 17 *** 4 50 33 if ($y && $z) { | |
41 | 18 *** 0 $x[1]++; | |
40 | 17 *** 4 * 50 * 33 if ($y && $z) { | |
41 | 18 *** *0 $x[1]++; | |
42 | 42 | 19 } else { |
43 | 43 | 20 4 $x[2]++; |
44 | 44 | 21 } |
45 | 22 *** 4 100 66 if ($y || $z) { | |
45 | 22 *** 4 100 * 66 if ($y || $z) { | |
46 | 46 | 23 2 $x[3]++; |
47 | 47 | 24 } else { |
48 | 48 | 25 2 $x[4]++; |
49 | 49 | 26 } |
50 | 50 | 27 |
51 | 28 *** 4 50 $y && $x[5]++; | |
52 | 29 *** 4 50 $x[5]++ if $y; | |
51 | 28 *** 4 * 50 $y && $x[5]++; | |
52 | 29 *** 4 * 50 $x[5]++ if $y; | |
53 | 53 | 30 |
54 | 54 | 31 4 100 $z && $x[6]++; |
55 | 55 | 32 4 100 $x[6]++ if $z; |
56 | 56 | 33 |
57 | 34 *** 4 50 $y || $x[7]++; | |
58 | 35 *** 4 50 $x[7]++ unless $y; | |
57 | 34 *** 4 * 50 $y || $x[7]++; | |
58 | 35 *** 4 * 50 $x[7]++ unless $y; | |
59 | 59 | 36 |
60 | 60 | 37 4 100 $z || $x[8]++; |
61 | 61 | 38 4 100 $x[8]++ unless $z; |
62 | 62 | 39 |
63 | 40 *** 4 50 $y ? $x[9]++ : $x[10]++; | |
63 | 40 *** 4 * 50 $y ? $x[9]++ : $x[10]++; | |
64 | 64 | 41 4 100 $z ? $x[11]++ : $x[12]++; |
65 | 65 | 42 |
66 | 43 *** 4 50 33 if ($y) { | |
67 | *** 50 66 | |
66 | 43 *** 4 * 50 * 33 if ($y) { | |
67 | *** * 50 * 66 | |
68 | 68 | 100 |
69 | 44 *** 0 $x[13]++; | |
69 | 44 *** *0 $x[13]++; | |
70 | 70 | 45 } elsif ($y && $z) { |
71 | 46 *** 0 $x[14]++; | |
71 | 46 *** *0 $x[14]++; | |
72 | 72 | 47 } elsif ($y || $z) { |
73 | 73 | 48 2 $x[15]++; |
74 | 74 | 49 } else { |
75 | 75 | 50 2 $x[16]++; |
76 | 76 | 51 } |
77 | 77 | 52 |
78 | 53 *** 4 50 33 $y && $z && $x[17]++; $y && $z && $x[18]++; | |
79 | *** 4 50 33 | |
78 | 53 *** 4 * 50 * 33 $y && $z && $x[17]++; $y && $z && $x[18]++; | |
79 | *** 4 * 50 * 33 | |
80 | 80 | 54 } |
81 | 81 | 55 } |
82 | 82 | 56 |
105 | 105 | 79 1 1 no warnings "void"; |
106 | 106 | 1 |
107 | 107 | 1 |
108 | 80 *** 2 0 my $w = $y xor next; | |
109 | 81 *** 0 $x[22]++; | |
108 | 80 *** 2 * 0 my $w = $y xor next; | |
109 | 81 *** *0 $x[22]++; | |
110 | 110 | 82 } |
111 | 111 | 83 |
112 | 112 | 84 1 for my $y (1, 0) { |
113 | 113 | 85 1 1 no warnings "void"; |
114 | 114 | 1 |
115 | 115 | 1 |
116 | 86 *** 2 0 my $w = $y xor next; | |
117 | 87 *** 0 $x[23]++; | |
116 | 86 *** 2 * 0 my $w = $y xor next; | |
117 | 87 *** *0 $x[23]++; | |
118 | 118 | 88 } |
119 | 119 | 89 |
120 | 120 | 90 |
121 | 121 | 91 1 for my $y (0, 1) { |
122 | 92 *** 1 50 $y || last; | |
123 | 93 *** 0 $x[24]++; | |
122 | 92 *** 1 * 50 $y || last; | |
123 | 93 *** *0 $x[24]++; | |
124 | 124 | 94 } |
125 | 125 | 95 |
126 | 126 | 96 1 for my $y (1, 0) { |
134 | 134 | 104 } |
135 | 135 | 105 |
136 | 136 | 106 1 for my $y (1, 0) { |
137 | 107 *** 1 50 $y && last; | |
138 | 108 *** 0 $x[27]++; | |
137 | 107 *** 1 * 50 $y && last; | |
138 | 108 *** *0 $x[27]++; | |
139 | 139 | 109 } |
140 | 140 | 110 |
141 | 141 | 111 1 for my $y (0, 1) { |
142 | 142 | 112 1 1 no warnings "void"; |
143 | 143 | 1 |
144 | 144 | 1 |
145 | 113 *** 1 0 my $w = $y xor last; | |
146 | 114 *** 0 $x[28]++; | |
145 | 113 *** 1 * 0 my $w = $y xor last; | |
146 | 114 *** *0 $x[28]++; | |
147 | 147 | 115 } |
148 | 148 | 116 |
149 | 149 | 117 1 for my $y (1, 0) { |
150 | 150 | 118 1 1 no warnings "void"; |
151 | 151 | 1 |
152 | 152 | 1 |
153 | 119 *** 1 0 my $w = $y xor last; | |
154 | 120 *** 0 $x[29]++; | |
153 | 119 *** 1 * 0 my $w = $y xor last; | |
154 | 120 *** *0 $x[29]++; | |
155 | 155 | 121 } |
156 | 156 | 122 |
157 | 157 | 123 |
158 | 158 | 124 1 for my $y (0, 1) { |
159 | 125 *** 1 50 $y || goto G1; | |
160 | 126 *** 0 $x[30]++; | |
159 | 125 *** 1 * 50 $y || goto G1; | |
160 | 126 *** *0 $x[30]++; | |
161 | 161 | 127 } |
162 | 162 | 128 G1: |
163 | 163 | 129 |
174 | 174 | 140 G3: |
175 | 175 | 141 |
176 | 176 | 142 1 for my $y (1, 0) { |
177 | 143 *** 1 50 $y && goto G4; | |
178 | 144 *** 0 $x[33]++; | |
177 | 143 *** 1 * 50 $y && goto G4; | |
178 | 144 *** *0 $x[33]++; | |
179 | 179 | 145 } |
180 | 180 | 146 G4: |
181 | 181 | 147 |
183 | 183 | 149 1 1 no warnings "void"; |
184 | 184 | 1 |
185 | 185 | 1 |
186 | 150 *** 1 0 my $w = $y xor goto G5; | |
187 | 151 *** 0 $x[34]++; | |
186 | 150 *** 1 * 0 my $w = $y xor goto G5; | |
187 | 151 *** *0 $x[34]++; | |
188 | 188 | 152 } |
189 | 189 | 153 G5: |
190 | 190 | 154 |
192 | 192 | 156 1 1 no warnings "void"; |
193 | 193 | 1 |
194 | 194 | 1 |
195 | 157 *** 1 0 my $w = $y xor goto G6; | |
196 | 158 *** 0 $x[35]++; | |
195 | 157 *** 1 * 0 my $w = $y xor goto G6; | |
196 | 158 *** *0 $x[35]++; | |
197 | 197 | 159 } |
198 | 198 | 160 G6: |
199 | 199 | 161 |
240 | 240 | 202 1 1 no warnings "void"; |
241 | 241 | 1 |
242 | 242 | 1 |
243 | 203 *** 2 0 my $w = $z xor redo; | |
244 | 204 *** 0 $x[40]++; | |
243 | 203 *** 2 * 0 my $w = $z xor redo; | |
244 | 204 *** *0 $x[40]++; | |
245 | 245 | 205 } |
246 | 246 | 206 |
247 | 247 | 207 1 $z = -1; |
251 | 251 | 211 1 1 no warnings "void"; |
252 | 252 | 1 |
253 | 253 | 1 |
254 | 212 *** 2 0 my $w = !$z xor redo; | |
255 | 213 *** 0 $x[41]++; | |
254 | 212 *** 2 * 0 my $w = !$z xor redo; | |
255 | 213 *** *0 $x[41]++; | |
256 | 256 | 214 } |
257 | 257 | 215 |
258 | 258 | 216 |
271 | 271 | 229 1 1 no warnings "void"; |
272 | 272 | 1 |
273 | 273 | 1 |
274 | 230 *** 4 0 4 shift xor return; | |
275 | 231 *** 0 $x[44]++; | |
274 | 230 *** 4 * 0 4 shift xor return; | |
275 | 231 *** *0 $x[44]++; | |
276 | 276 | 232 }, |
277 | 277 | 233 |
278 | 278 | 234 sub { |
341 | 341 | 296 |
342 | 342 | 297 1 my ($a, $b) = (0, 1); |
343 | 343 | 298 |
344 | 299 *** 1 50 33 if ($a && $b) { | |
345 | *** 50 33 | |
346 | *** 50 50 | |
347 | 300 *** 0 print "path 1\n"; | |
344 | 299 *** 1 * 50 * 33 if ($a && $b) { | |
345 | *** * 50 * 33 | |
346 | *** * 50 * 50 | |
347 | 300 *** *0 print "path 1\n"; | |
348 | 348 | 301 } elsif (!$a && !$b) { |
349 | 302 *** 0 print "path 2\n"; | |
349 | 302 *** *0 print "path 2\n"; | |
350 | 350 | 303 } elsif ($b || 0) { |
351 | 351 | 304 1 print "path 3\n"; |
352 | 305 *** 1 50 33 if (!$b || $a) { | |
353 | *** 50 33 | |
354 | 306 *** 0 print "path 4\n"; | |
352 | 305 *** 1 * 50 * 33 if (!$b || $a) { | |
353 | *** * 50 * 33 | |
354 | 306 *** *0 print "path 4\n"; | |
355 | 355 | 307 } elsif (!$a && $b) { |
356 | 356 | 308 1 print "path 5\n"; |
357 | 357 | 309 } |
37 | 37 | 14 |
38 | 38 | 15 1 for my $y (0, 0) { |
39 | 39 | 16 2 for my $z (1, 0) { |
40 | 17 *** 4 50 33 if ($y && $z) { | |
41 | 18 *** 0 $x[1]++; | |
40 | 17 *** 4 * 50 * 33 if ($y && $z) { | |
41 | 18 *** *0 $x[1]++; | |
42 | 42 | 19 } else { |
43 | 43 | 20 4 $x[2]++; |
44 | 44 | 21 } |
45 | 22 *** 4 100 66 if ($y || $z) { | |
45 | 22 *** 4 100 * 66 if ($y || $z) { | |
46 | 46 | 23 2 $x[3]++; |
47 | 47 | 24 } else { |
48 | 48 | 25 2 $x[4]++; |
49 | 49 | 26 } |
50 | 50 | 27 |
51 | 28 *** 4 50 $y && $x[5]++; | |
52 | 29 *** 4 50 $x[5]++ if $y; | |
51 | 28 *** 4 * 50 $y && $x[5]++; | |
52 | 29 *** 4 * 50 $x[5]++ if $y; | |
53 | 53 | 30 |
54 | 54 | 31 4 100 $z && $x[6]++; |
55 | 55 | 32 4 100 $x[6]++ if $z; |
56 | 56 | 33 |
57 | 34 *** 4 50 $y || $x[7]++; | |
58 | 35 *** 4 50 $x[7]++ unless $y; | |
57 | 34 *** 4 * 50 $y || $x[7]++; | |
58 | 35 *** 4 * 50 $x[7]++ unless $y; | |
59 | 59 | 36 |
60 | 60 | 37 4 100 $z || $x[8]++; |
61 | 61 | 38 4 100 $x[8]++ unless $z; |
62 | 62 | 39 |
63 | 40 *** 4 50 $y ? $x[9]++ : $x[10]++; | |
63 | 40 *** 4 * 50 $y ? $x[9]++ : $x[10]++; | |
64 | 64 | 41 4 100 $z ? $x[11]++ : $x[12]++; |
65 | 65 | 42 |
66 | 43 *** 4 50 33 if ($y) { | |
67 | *** 50 66 | |
66 | 43 *** 4 * 50 * 33 if ($y) { | |
67 | *** * 50 * 66 | |
68 | 68 | 100 |
69 | 44 *** 0 $x[13]++; | |
69 | 44 *** *0 $x[13]++; | |
70 | 70 | 45 } elsif ($y && $z) { |
71 | 46 *** 0 $x[14]++; | |
71 | 46 *** *0 $x[14]++; | |
72 | 72 | 47 } elsif ($y || $z) { |
73 | 73 | 48 2 $x[15]++; |
74 | 74 | 49 } else { |
75 | 75 | 50 2 $x[16]++; |
76 | 76 | 51 } |
77 | 77 | 52 |
78 | 53 *** 4 50 33 $y && $z && $x[17]++; $y && $z && $x[18]++; | |
79 | *** 4 50 33 | |
78 | 53 *** 4 * 50 * 33 $y && $z && $x[17]++; $y && $z && $x[18]++; | |
79 | *** 4 * 50 * 33 | |
80 | 80 | 54 } |
81 | 81 | 55 } |
82 | 82 | 56 |
105 | 105 | 79 1 1 no warnings "void"; |
106 | 106 | 1 |
107 | 107 | 1 |
108 | 80 *** 2 0 my $w = $y xor next; | |
109 | 81 *** 0 $x[22]++; | |
108 | 80 *** 2 * 0 my $w = $y xor next; | |
109 | 81 *** *0 $x[22]++; | |
110 | 110 | 82 } |
111 | 111 | 83 |
112 | 112 | 84 1 for my $y (1, 0) { |
113 | 113 | 85 1 1 no warnings "void"; |
114 | 114 | 1 |
115 | 115 | 1 |
116 | 86 *** 2 0 my $w = $y xor next; | |
117 | 87 *** 0 $x[23]++; | |
116 | 86 *** 2 * 0 my $w = $y xor next; | |
117 | 87 *** *0 $x[23]++; | |
118 | 118 | 88 } |
119 | 119 | 89 |
120 | 120 | 90 |
121 | 121 | 91 1 for my $y (0, 1) { |
122 | 92 *** 1 50 $y || last; | |
123 | 93 *** 0 $x[24]++; | |
122 | 92 *** 1 * 50 $y || last; | |
123 | 93 *** *0 $x[24]++; | |
124 | 124 | 94 } |
125 | 125 | 95 |
126 | 126 | 96 1 for my $y (1, 0) { |
134 | 134 | 104 } |
135 | 135 | 105 |
136 | 136 | 106 1 for my $y (1, 0) { |
137 | 107 *** 1 50 $y && last; | |
138 | 108 *** 0 $x[27]++; | |
137 | 107 *** 1 * 50 $y && last; | |
138 | 108 *** *0 $x[27]++; | |
139 | 139 | 109 } |
140 | 140 | 110 |
141 | 141 | 111 1 for my $y (0, 1) { |
142 | 142 | 112 1 1 no warnings "void"; |
143 | 143 | 1 |
144 | 144 | 1 |
145 | 113 *** 1 0 my $w = $y xor last; | |
146 | 114 *** 0 $x[28]++; | |
145 | 113 *** 1 * 0 my $w = $y xor last; | |
146 | 114 *** *0 $x[28]++; | |
147 | 147 | 115 } |
148 | 148 | 116 |
149 | 149 | 117 1 for my $y (1, 0) { |
150 | 150 | 118 1 1 no warnings "void"; |
151 | 151 | 1 |
152 | 152 | 1 |
153 | 119 *** 1 0 my $w = $y xor last; | |
154 | 120 *** 0 $x[29]++; | |
153 | 119 *** 1 * 0 my $w = $y xor last; | |
154 | 120 *** *0 $x[29]++; | |
155 | 155 | 121 } |
156 | 156 | 122 |
157 | 157 | 123 |
158 | 158 | 124 1 for my $y (0, 1) { |
159 | 125 *** 1 50 $y || goto G1; | |
160 | 126 *** 0 $x[30]++; | |
159 | 125 *** 1 * 50 $y || goto G1; | |
160 | 126 *** *0 $x[30]++; | |
161 | 161 | 127 } |
162 | 162 | 128 G1: |
163 | 163 | 129 |
174 | 174 | 140 G3: |
175 | 175 | 141 |
176 | 176 | 142 1 for my $y (1, 0) { |
177 | 143 *** 1 50 $y && goto G4; | |
178 | 144 *** 0 $x[33]++; | |
177 | 143 *** 1 * 50 $y && goto G4; | |
178 | 144 *** *0 $x[33]++; | |
179 | 179 | 145 } |
180 | 180 | 146 G4: |
181 | 181 | 147 |
183 | 183 | 149 1 1 no warnings "void"; |
184 | 184 | 1 |
185 | 185 | 1 |
186 | 150 *** 1 0 my $w = $y xor goto G5; | |
187 | 151 *** 0 $x[34]++; | |
186 | 150 *** 1 * 0 my $w = $y xor goto G5; | |
187 | 151 *** *0 $x[34]++; | |
188 | 188 | 152 } |
189 | 189 | 153 G5: |
190 | 190 | 154 |
192 | 192 | 156 1 1 no warnings "void"; |
193 | 193 | 1 |
194 | 194 | 1 |
195 | 157 *** 1 0 my $w = $y xor goto G6; | |
196 | 158 *** 0 $x[35]++; | |
195 | 157 *** 1 * 0 my $w = $y xor goto G6; | |
196 | 158 *** *0 $x[35]++; | |
197 | 197 | 159 } |
198 | 198 | 160 G6: |
199 | 199 | 161 |
240 | 240 | 202 1 1 no warnings "void"; |
241 | 241 | 1 |
242 | 242 | 1 |
243 | 203 *** 2 0 my $w = $z xor redo; | |
244 | 204 *** 0 $x[40]++; | |
243 | 203 *** 2 * 0 my $w = $z xor redo; | |
244 | 204 *** *0 $x[40]++; | |
245 | 245 | 205 } |
246 | 246 | 206 |
247 | 247 | 207 1 $z = -1; |
251 | 251 | 211 1 1 no warnings "void"; |
252 | 252 | 1 |
253 | 253 | 1 |
254 | 212 *** 2 0 my $w = !$z xor redo; | |
255 | 213 *** 0 $x[41]++; | |
254 | 212 *** 2 * 0 my $w = !$z xor redo; | |
255 | 213 *** *0 $x[41]++; | |
256 | 256 | 214 } |
257 | 257 | 215 |
258 | 258 | 216 |
271 | 271 | 229 1 1 no warnings "void"; |
272 | 272 | 1 |
273 | 273 | 1 |
274 | 230 *** 4 0 4 shift xor return; | |
275 | 231 *** 0 $x[44]++; | |
274 | 230 *** 4 * 0 4 shift xor return; | |
275 | 231 *** *0 $x[44]++; | |
276 | 276 | 232 }, |
277 | 277 | 233 |
278 | 278 | 234 sub { |
341 | 341 | 296 |
342 | 342 | 297 1 my ($a, $b) = (0, 1); |
343 | 343 | 298 |
344 | 299 *** 1 50 33 if ($a && $b) { | |
345 | *** 50 33 | |
346 | *** 50 50 | |
347 | 300 *** 0 print "path 1\n"; | |
344 | 299 *** 1 * 50 * 33 if ($a && $b) { | |
345 | *** * 50 * 33 | |
346 | *** * 50 * 50 | |
347 | 300 *** *0 print "path 1\n"; | |
348 | 348 | 301 } elsif (!$a && !$b) { |
349 | 302 *** 0 print "path 2\n"; | |
349 | 302 *** *0 print "path 2\n"; | |
350 | 350 | 303 } elsif ($b || 0) { |
351 | 351 | 304 1 print "path 3\n"; |
352 | 305 *** 1 50 33 if (!$b || $a) { | |
353 | *** 50 33 | |
354 | 306 *** 0 print "path 4\n"; | |
352 | 305 *** 1 * 50 * 33 if (!$b || $a) { | |
353 | *** * 50 * 33 | |
354 | 306 *** *0 print "path 4\n"; | |
355 | 355 | 307 } elsif (!$a && $b) { |
356 | 356 | 308 1 print "path 5\n"; |
357 | 357 | 309 } |
37 | 37 | 14 |
38 | 38 | 15 1 for my $y (0, 0) { |
39 | 39 | 16 2 for my $z (1, 0) { |
40 | 17 *** 4 50 33 if ($y && $z) { | |
41 | 18 *** 0 $x[1]++; | |
40 | 17 *** 4 * 50 * 33 if ($y && $z) { | |
41 | 18 *** *0 $x[1]++; | |
42 | 42 | 19 } else { |
43 | 43 | 20 4 $x[2]++; |
44 | 44 | 21 } |
45 | 22 *** 4 100 66 if ($y || $z) { | |
45 | 22 *** 4 100 * 66 if ($y || $z) { | |
46 | 46 | 23 2 $x[3]++; |
47 | 47 | 24 } else { |
48 | 48 | 25 2 $x[4]++; |
49 | 49 | 26 } |
50 | 50 | 27 |
51 | 28 *** 4 50 $y && $x[5]++; | |
52 | 29 *** 4 50 $x[5]++ if $y; | |
51 | 28 *** 4 * 50 $y && $x[5]++; | |
52 | 29 *** 4 * 50 $x[5]++ if $y; | |
53 | 53 | 30 |
54 | 54 | 31 4 100 $z && $x[6]++; |
55 | 55 | 32 4 100 $x[6]++ if $z; |
56 | 56 | 33 |
57 | 34 *** 4 50 $y || $x[7]++; | |
58 | 35 *** 4 50 $x[7]++ unless $y; | |
57 | 34 *** 4 * 50 $y || $x[7]++; | |
58 | 35 *** 4 * 50 $x[7]++ unless $y; | |
59 | 59 | 36 |
60 | 60 | 37 4 100 $z || $x[8]++; |
61 | 61 | 38 4 100 $x[8]++ unless $z; |
62 | 62 | 39 |
63 | 40 *** 4 50 $y ? $x[9]++ : $x[10]++; | |
63 | 40 *** 4 * 50 $y ? $x[9]++ : $x[10]++; | |
64 | 64 | 41 4 100 $z ? $x[11]++ : $x[12]++; |
65 | 65 | 42 |
66 | 43 *** 4 50 33 if ($y) { | |
67 | *** 50 66 | |
66 | 43 *** 4 * 50 * 33 if ($y) { | |
67 | *** * 50 * 66 | |
68 | 68 | 100 |
69 | 44 *** 0 $x[13]++; | |
69 | 44 *** *0 $x[13]++; | |
70 | 70 | 45 } elsif ($y && $z) { |
71 | 46 *** 0 $x[14]++; | |
71 | 46 *** *0 $x[14]++; | |
72 | 72 | 47 } elsif ($y || $z) { |
73 | 73 | 48 2 $x[15]++; |
74 | 74 | 49 } else { |
75 | 75 | 50 2 $x[16]++; |
76 | 76 | 51 } |
77 | 77 | 52 |
78 | 53 *** 4 50 33 $y && $z && $x[17]++; $y && $z && $x[18]++; | |
79 | *** 4 50 33 | |
78 | 53 *** 4 * 50 * 33 $y && $z && $x[17]++; $y && $z && $x[18]++; | |
79 | *** 4 * 50 * 33 | |
80 | 80 | 54 } |
81 | 81 | 55 } |
82 | 82 | 56 |
105 | 105 | 79 1 1 no warnings "void"; |
106 | 106 | 1 |
107 | 107 | 1 |
108 | 80 *** 2 0 my $w = $y xor next; | |
109 | 81 *** 0 $x[22]++; | |
108 | 80 *** 2 * 0 my $w = $y xor next; | |
109 | 81 *** *0 $x[22]++; | |
110 | 110 | 82 } |
111 | 111 | 83 |
112 | 112 | 84 1 for my $y (1, 0) { |
113 | 113 | 85 1 1 no warnings "void"; |
114 | 114 | 1 |
115 | 115 | 1 |
116 | 86 *** 2 0 my $w = $y xor next; | |
117 | 87 *** 0 $x[23]++; | |
116 | 86 *** 2 * 0 my $w = $y xor next; | |
117 | 87 *** *0 $x[23]++; | |
118 | 118 | 88 } |
119 | 119 | 89 |
120 | 120 | 90 |
121 | 121 | 91 1 for my $y (0, 1) { |
122 | 92 *** 1 50 $y || last; | |
123 | 93 *** 0 $x[24]++; | |
122 | 92 *** 1 * 50 $y || last; | |
123 | 93 *** *0 $x[24]++; | |
124 | 124 | 94 } |
125 | 125 | 95 |
126 | 126 | 96 1 for my $y (1, 0) { |
134 | 134 | 104 } |
135 | 135 | 105 |
136 | 136 | 106 1 for my $y (1, 0) { |
137 | 107 *** 1 50 $y && last; | |
138 | 108 *** 0 $x[27]++; | |
137 | 107 *** 1 * 50 $y && last; | |
138 | 108 *** *0 $x[27]++; | |
139 | 139 | 109 } |
140 | 140 | 110 |
141 | 141 | 111 1 for my $y (0, 1) { |
142 | 142 | 112 1 1 no warnings "void"; |
143 | 143 | 1 |
144 | 144 | 1 |
145 | 113 *** 1 0 my $w = $y xor last; | |
146 | 114 *** 0 $x[28]++; | |
145 | 113 *** 1 * 0 my $w = $y xor last; | |
146 | 114 *** *0 $x[28]++; | |
147 | 147 | 115 } |
148 | 148 | 116 |
149 | 149 | 117 1 for my $y (1, 0) { |
150 | 150 | 118 1 1 no warnings "void"; |
151 | 151 | 1 |
152 | 152 | 1 |
153 | 119 *** 1 0 my $w = $y xor last; | |
154 | 120 *** 0 $x[29]++; | |
153 | 119 *** 1 * 0 my $w = $y xor last; | |
154 | 120 *** *0 $x[29]++; | |
155 | 155 | 121 } |
156 | 156 | 122 |
157 | 157 | 123 |
158 | 158 | 124 1 for my $y (0, 1) { |
159 | 125 *** 1 50 $y || goto G1; | |
160 | 126 *** 0 $x[30]++; | |
159 | 125 *** 1 * 50 $y || goto G1; | |
160 | 126 *** *0 $x[30]++; | |
161 | 161 | 127 } |
162 | 162 | 128 G1: |
163 | 163 | 129 |
174 | 174 | 140 G3: |
175 | 175 | 141 |
176 | 176 | 142 1 for my $y (1, 0) { |
177 | 143 *** 1 50 $y && goto G4; | |
178 | 144 *** 0 $x[33]++; | |
177 | 143 *** 1 * 50 $y && goto G4; | |
178 | 144 *** *0 $x[33]++; | |
179 | 179 | 145 } |
180 | 180 | 146 G4: |
181 | 181 | 147 |
183 | 183 | 149 1 1 no warnings "void"; |
184 | 184 | 1 |
185 | 185 | 1 |
186 | 150 *** 1 0 my $w = $y xor goto G5; | |
187 | 151 *** 0 $x[34]++; | |
186 | 150 *** 1 * 0 my $w = $y xor goto G5; | |
187 | 151 *** *0 $x[34]++; | |
188 | 188 | 152 } |
189 | 189 | 153 G5: |
190 | 190 | 154 |
192 | 192 | 156 1 1 no warnings "void"; |
193 | 193 | 1 |
194 | 194 | 1 |
195 | 157 *** 1 0 my $w = $y xor goto G6; | |
196 | 158 *** 0 $x[35]++; | |
195 | 157 *** 1 * 0 my $w = $y xor goto G6; | |
196 | 158 *** *0 $x[35]++; | |
197 | 197 | 159 } |
198 | 198 | 160 G6: |
199 | 199 | 161 |
240 | 240 | 202 1 1 no warnings "void"; |
241 | 241 | 1 |
242 | 242 | 1 |
243 | 203 *** 2 0 my $w = $z xor redo; | |
244 | 204 *** 0 $x[40]++; | |
243 | 203 *** 2 * 0 my $w = $z xor redo; | |
244 | 204 *** *0 $x[40]++; | |
245 | 245 | 205 } |
246 | 246 | 206 |
247 | 247 | 207 1 $z = -1; |
251 | 251 | 211 1 1 no warnings "void"; |
252 | 252 | 1 |
253 | 253 | 1 |
254 | 212 *** 2 0 my $w = !$z xor redo; | |
255 | 213 *** 0 $x[41]++; | |
254 | 212 *** 2 * 0 my $w = !$z xor redo; | |
255 | 213 *** *0 $x[41]++; | |
256 | 256 | 214 } |
257 | 257 | 215 |
258 | 258 | 216 |
271 | 271 | 229 1 1 no warnings "void"; |
272 | 272 | 1 |
273 | 273 | 1 |
274 | 230 *** 4 0 4 shift xor return; | |
275 | 231 *** 0 $x[44]++; | |
274 | 230 *** 4 * 0 4 shift xor return; | |
275 | 231 *** *0 $x[44]++; | |
276 | 276 | 232 }, |
277 | 277 | 233 |
278 | 278 | 234 sub { |
341 | 341 | 296 |
342 | 342 | 297 1 my ($a, $b) = (0, 1); |
343 | 343 | 298 |
344 | 299 *** 1 50 33 if ($a && $b) { | |
345 | *** 50 33 | |
346 | *** 50 50 | |
347 | 300 *** 0 print "path 1\n"; | |
344 | 299 *** 1 * 50 * 33 if ($a && $b) { | |
345 | *** * 50 * 33 | |
346 | *** * 50 * 50 | |
347 | 300 *** *0 print "path 1\n"; | |
348 | 348 | 301 } elsif (!$a && !$b) { |
349 | 302 *** 0 print "path 2\n"; | |
349 | 302 *** *0 print "path 2\n"; | |
350 | 350 | 303 } elsif ($b || 0) { |
351 | 351 | 304 1 print "path 3\n"; |
352 | 305 *** 1 50 33 if (!$b || $a) { | |
353 | *** 50 33 | |
354 | 306 *** 0 print "path 4\n"; | |
352 | 305 *** 1 * 50 * 33 if (!$b || $a) { | |
353 | *** * 50 * 33 | |
354 | 306 *** *0 print "path 4\n"; | |
355 | 355 | 307 } elsif (!$a && $b) { |
356 | 356 | 308 1 print "path 5\n"; |
357 | 357 | 309 } |
34 | 34 | 15 sub t3 { |
35 | 35 | 16 1 1 for my $x (0, 1, 2) { |
36 | 36 | 17 3 100 100 last if $x && $x == 2 && $x == 2 && $x == 2; |
37 | *** 66 | |
38 | *** 66 | |
37 | *** * 66 | |
38 | *** * 66 | |
39 | 39 | 18 } |
40 | 40 | 19 } |
41 | 41 | 20 |
33 | 33 | 14 |
34 | 34 | 15 sub t3 { |
35 | 35 | 16 1 1 for my $x (0, 1, 2) { |
36 | 17 *** 3 50 100 last if $x && $x == 2 && $x == 2 && $x == 2; | |
37 | *** 66 | |
38 | *** 66 | |
36 | 17 *** 3 * 50 100 last if $x && $x == 2 && $x == 2 && $x == 2; | |
37 | *** * 66 | |
38 | *** * 66 | |
39 | 39 | 18 } |
40 | 40 | 19 } |
41 | 41 | 20 |
43 | 43 | 19 1 my $z = 0; |
44 | 44 | 20 1 $::foo = 17; |
45 | 45 | 21 |
46 | 22 *** 1 50 if ($] >= 5.009) { | |
46 | 22 *** 1 * 50 if ($] >= 5.009) { | |
47 | 47 | 23 1 $ENV{PATH} = "/bin"; |
48 | 48 | 24 1 system "pwd"; |
49 | 49 | 25 1 1 use lib "tests"; |
50 | 50 | 1 |
51 | 51 | 1 |
52 | 52 | 26 1 my $file = "cond_or.pl"; |
53 | 27 *** 1 50 unless (my $return = do $file) { | |
54 | 28 *** 0 0 die "couldn't parse $file: $@" if $@; | |
55 | 29 *** 0 0 die "couldn't do $file: $!" unless defined $return; | |
56 | 30 *** 0 0 die "couldn't run $file" unless $return; | |
53 | 27 *** 1 * 50 unless (my $return = do $file) { | |
54 | 28 *** *0 * 0 die "couldn't parse $file: $@" if $@; | |
55 | 29 *** *0 * 0 die "couldn't do $file: $!" unless defined $return; | |
56 | 30 *** *0 * 0 die "couldn't run $file" unless $return; | |
57 | 57 | 31 } |
58 | 58 | 32 } |
59 | 59 | 33 |
60 | 60 | 34 1 for my $i (0 .. 10) { |
61 | 35 *** 11 50 $y || | |
61 | 35 *** 11 * 50 $y || | |
62 | 62 | 36 $x[1]++; |
63 | 63 | 37 |
64 | 38 *** 11 50 33 $y || | |
64 | 38 *** 11 * 50 * 33 $y || | |
65 | 65 | 39 $x[0]++ || |
66 | 66 | 40 $x[1]++; |
67 | 67 | 41 |
68 | 42 *** 11 50 $x[2]++ | |
68 | 42 *** 11 * 50 $x[2]++ | |
69 | 69 | 43 unless $z; |
70 | 70 | 44 |
71 | 71 | 45 11 for (0 .. 2) { |
72 | 72 | 46 33 $x[3]++; |
73 | 73 | 47 } |
74 | 74 | 48 |
75 | 49 *** 11 50 if ($z) { | |
76 | 50 *** 0 $x[4]++; | |
75 | 49 *** 11 * 50 if ($z) { | |
76 | 50 *** *0 $x[4]++; | |
77 | 77 | 51 } else { |
78 | 78 | 52 11 $x[5]++; |
79 | 79 | 53 } |
80 | 80 | 54 |
81 | 55 *** 11 33 my $p = $y || $z; | |
82 | 56 *** 11 33 my $q = $z || $y; | |
81 | 55 *** 11 * 33 my $p = $y || $z; | |
82 | 56 *** 11 * 33 my $q = $z || $y; | |
83 | 83 | 57 11 100 my $r = $i || "qqq"; |
84 | 84 | 58 11 100 my $s = $i || []; |
85 | 85 | 59 11 my $t = $y | $z; |
86 | 60 *** 11 50 my $u = $y || 0; | |
87 | 61 *** 11 50 my $v = $y || undef; | |
88 | 62 *** 11 50 my $w = $z || 0; | |
86 | 60 *** 11 * 50 my $u = $y || 0; | |
87 | 61 *** 11 * 50 my $v = $y || undef; | |
88 | 62 *** 11 * 50 my $w = $z || 0; | |
89 | 89 | 63 |
90 | 64 *** 11 33 $p ||= $y; | |
91 | 65 *** 11 33 $p ||= $z; | |
92 | 66 *** 11 66 $x[ 6] ||= $y; | |
93 | 67 *** 11 33 $x[ 7] ||= $z; | |
90 | 64 *** 11 * 33 $p ||= $y; | |
91 | 65 *** 11 * 33 $p ||= $z; | |
92 | 66 *** 11 * 66 $x[ 6] ||= $y; | |
93 | 67 *** 11 * 33 $x[ 7] ||= $z; | |
94 | 94 | 68 11 100 $x[ 8] ||= 1; |
95 | 95 | 69 11 100 $x[ 9] ||= {}; |
96 | 96 | 70 11 100 $x[10] ||= \"foo"; |
97 | 97 | 71 11 100 $x[11] ||= \$y; |
98 | 98 | 72 11 100 $x[12] ||= \*STDIO; |
99 | 73 *** 11 100 0 $x[13] ||= sub { 1 }; | |
100 | *** 0 | |
99 | 73 *** 11 100 *0 $x[13] ||= sub { 1 }; | |
100 | *** *0 | |
101 | 101 | 74 11 100 $x[14] ||= *::foo{SCALAR}; |
102 | 75 *** 11 50 $x[15] ||= *STDIO{IO}; | |
102 | 75 *** 11 * 50 $x[15] ||= *STDIO{IO}; | |
103 | 103 | 76 11 100 $x[16] ||= bless {}, "XXX"; |
104 | 104 | 77 11 100 $x[17] ||= $i == 1; |
105 | 78 *** 11 33 $w ||= ref($i) eq "SCALAR"; | |
105 | 78 *** 11 * 33 $w ||= ref($i) eq "SCALAR"; | |
106 | 106 | 79 11 100 $x[18] ||= <<"EOD"; |
107 | 107 | 80 blah |
108 | 108 | 81 EOD |
109 | 82 *** 11 50 cond_dor(\@x) if exists &cond_dor; | |
110 | 83 *** 11 0 0 sub { $x[19] ||= 1 }; | |
111 | *** 0 | |
109 | 82 *** 11 * 50 cond_dor(\@x) if exists &cond_dor; | |
110 | 83 *** 11 * 0 *0 sub { $x[19] ||= 1 }; | |
111 | *** *0 | |
112 | 112 | 84 } |
113 | 113 | 85 |
114 | 114 | 86 # print join(", ", @x), "\n"; |
213 | 213 | 13 sub cond_dor { |
214 | 214 | 14 11 11 my ($x) = @_; |
215 | 215 | 15 |
216 | 16 *** 11 50 $x->[18] //= undef; | |
217 | 17 *** 11 50 $x->[18] //= 0; | |
218 | 18 *** 11 50 $x->[18] //= 0; | |
219 | 19 *** 11 50 $x->[18] //= 1; | |
220 | 20 *** 11 50 $x->[18] //= 1; | |
216 | 16 *** 11 * 50 $x->[18] //= undef; | |
217 | 17 *** 11 * 50 $x->[18] //= 0; | |
218 | 18 *** 11 * 50 $x->[18] //= 0; | |
219 | 19 *** 11 * 50 $x->[18] //= 1; | |
220 | 20 *** 11 * 50 $x->[18] //= 1; | |
221 | 221 | 21 |
222 | 222 | 22 11 100 $x->[19] //= 1; |
223 | 23 *** 11 50 $x->[19] //= 1; | |
224 | 24 *** 11 50 $x->[19] //= 0; | |
225 | 25 *** 11 50 $x->[19] //= undef; | |
226 | 26 *** 11 50 $x->[19] //= 1; | |
223 | 23 *** 11 * 50 $x->[19] //= 1; | |
224 | 24 *** 11 * 50 $x->[19] //= 0; | |
225 | 25 *** 11 * 50 $x->[19] //= undef; | |
226 | 26 *** 11 * 50 $x->[19] //= 1; | |
227 | 227 | 27 |
228 | 28 *** 11 50 $x->[20] = $x->[21] // undef; | |
229 | 29 *** 11 50 $x->[20] = $x->[21] // 0; | |
230 | 30 *** 11 50 $x->[20] = $x->[21] // 0; | |
231 | 31 *** 11 50 $x->[20] = $x->[21] // 1; | |
232 | 32 *** 11 50 $x->[20] = $x->[21] // 1; | |
228 | 28 *** 11 * 50 $x->[20] = $x->[21] // undef; | |
229 | 29 *** 11 * 50 $x->[20] = $x->[21] // 0; | |
230 | 30 *** 11 * 50 $x->[20] = $x->[21] // 0; | |
231 | 31 *** 11 * 50 $x->[20] = $x->[21] // 1; | |
232 | 32 *** 11 * 50 $x->[20] = $x->[21] // 1; | |
233 | 233 | 33 |
234 | 234 | 34 11 100 $x->[22] = $x->[22] // undef; |
235 | 235 | 35 11 100 $x->[22] = $x->[22] // 0; |
236 | 36 *** 11 50 $x->[22] = $x->[22] // 0; | |
237 | 37 *** 11 50 $x->[22] = $x->[22] // 1; | |
238 | 38 *** 11 50 $x->[22] = $x->[22] // 1; | |
236 | 36 *** 11 * 50 $x->[22] = $x->[22] // 0; | |
237 | 37 *** 11 * 50 $x->[22] = $x->[22] // 1; | |
238 | 38 *** 11 * 50 $x->[22] = $x->[22] // 1; | |
239 | 239 | 39 } |
240 | 240 | 40 |
241 | 241 | 41 1; |
43 | 43 | 19 1 my $z = 0; |
44 | 44 | 20 1 $::foo = 17; |
45 | 45 | 21 |
46 | 22 *** 1 50 if ($] >= 5.009) { | |
46 | 22 *** 1 * 50 if ($] >= 5.009) { | |
47 | 47 | 23 1 $ENV{PATH} = "/bin"; |
48 | 48 | 24 1 system "pwd"; |
49 | 49 | 25 1 1 use lib "tests"; |
50 | 50 | 1 |
51 | 51 | 1 |
52 | 52 | 26 1 my $file = "cond_or.pl"; |
53 | 27 *** 1 50 unless (my $return = do $file) { | |
54 | 28 *** 0 0 die "couldn't parse $file: $@" if $@; | |
55 | 29 *** 0 0 die "couldn't do $file: $!" unless defined $return; | |
56 | 30 *** 0 0 die "couldn't run $file" unless $return; | |
53 | 27 *** 1 * 50 unless (my $return = do $file) { | |
54 | 28 *** *0 * 0 die "couldn't parse $file: $@" if $@; | |
55 | 29 *** *0 * 0 die "couldn't do $file: $!" unless defined $return; | |
56 | 30 *** *0 * 0 die "couldn't run $file" unless $return; | |
57 | 57 | 31 } |
58 | 58 | 32 } |
59 | 59 | 33 |
60 | 60 | 34 1 for my $i (0 .. 10) { |
61 | 35 *** 11 50 $y || | |
61 | 35 *** 11 * 50 $y || | |
62 | 62 | 36 $x[1]++; |
63 | 63 | 37 |
64 | 38 *** 11 50 33 $y || | |
64 | 38 *** 11 * 50 * 33 $y || | |
65 | 65 | 39 $x[0]++ || |
66 | 66 | 40 $x[1]++; |
67 | 67 | 41 |
68 | 42 *** 11 50 $x[2]++ | |
68 | 42 *** 11 * 50 $x[2]++ | |
69 | 69 | 43 unless $z; |
70 | 70 | 44 |
71 | 71 | 45 11 for (0 .. 2) { |
72 | 72 | 46 33 $x[3]++; |
73 | 73 | 47 } |
74 | 74 | 48 |
75 | 49 *** 11 50 if ($z) { | |
76 | 50 *** 0 $x[4]++; | |
75 | 49 *** 11 * 50 if ($z) { | |
76 | 50 *** *0 $x[4]++; | |
77 | 77 | 51 } else { |
78 | 78 | 52 11 $x[5]++; |
79 | 79 | 53 } |
80 | 80 | 54 |
81 | 55 *** 11 33 my $p = $y || $z; | |
82 | 56 *** 11 33 my $q = $z || $y; | |
81 | 55 *** 11 * 33 my $p = $y || $z; | |
82 | 56 *** 11 * 33 my $q = $z || $y; | |
83 | 83 | 57 11 100 my $r = $i || "qqq"; |
84 | 84 | 58 11 100 my $s = $i || []; |
85 | 85 | 59 11 my $t = $y | $z; |
86 | 60 *** 11 50 my $u = $y || 0; | |
87 | 61 *** 11 50 my $v = $y || undef; | |
88 | 62 *** 11 50 my $w = $z || 0; | |
86 | 60 *** 11 * 50 my $u = $y || 0; | |
87 | 61 *** 11 * 50 my $v = $y || undef; | |
88 | 62 *** 11 * 50 my $w = $z || 0; | |
89 | 89 | 63 |
90 | 64 *** 11 33 $p ||= $y; | |
91 | 65 *** 11 33 $p ||= $z; | |
92 | 66 *** 11 66 $x[ 6] ||= $y; | |
93 | 67 *** 11 33 $x[ 7] ||= $z; | |
90 | 64 *** 11 * 33 $p ||= $y; | |
91 | 65 *** 11 * 33 $p ||= $z; | |
92 | 66 *** 11 * 66 $x[ 6] ||= $y; | |
93 | 67 *** 11 * 33 $x[ 7] ||= $z; | |
94 | 94 | 68 11 100 $x[ 8] ||= 1; |
95 | 95 | 69 11 100 $x[ 9] ||= {}; |
96 | 96 | 70 11 100 $x[10] ||= \"foo"; |
97 | 97 | 71 11 100 $x[11] ||= \$y; |
98 | 98 | 72 11 100 $x[12] ||= \*STDIO; |
99 | 73 *** 11 100 0 $x[13] ||= sub { 1 }; | |
100 | *** 0 | |
99 | 73 *** 11 100 *0 $x[13] ||= sub { 1 }; | |
100 | *** *0 | |
101 | 101 | 74 11 100 $x[14] ||= *::foo{SCALAR}; |
102 | 75 *** 11 50 $x[15] ||= *STDIO{IO}; | |
102 | 75 *** 11 * 50 $x[15] ||= *STDIO{IO}; | |
103 | 103 | 76 11 100 $x[16] ||= bless {}, "XXX"; |
104 | 104 | 77 11 100 $x[17] ||= $i == 1; |
105 | 78 *** 11 33 $w ||= ref($i) eq "SCALAR"; | |
105 | 78 *** 11 * 33 $w ||= ref($i) eq "SCALAR"; | |
106 | 106 | 79 11 100 $x[18] ||= <<"EOD"; |
107 | 107 | 80 blah |
108 | 108 | 81 EOD |
109 | 82 *** 11 50 cond_dor(\@x) if exists &cond_dor; | |
110 | 83 *** 11 0 0 sub { $x[19] ||= 1 }; | |
111 | *** 0 | |
109 | 82 *** 11 * 50 cond_dor(\@x) if exists &cond_dor; | |
110 | 83 *** 11 * 0 *0 sub { $x[19] ||= 1 }; | |
111 | *** *0 | |
112 | 112 | 84 } |
113 | 113 | 85 |
114 | 114 | 86 # print join(", ", @x), "\n"; |
213 | 213 | 13 sub cond_dor { |
214 | 214 | 14 11 11 my ($x) = @_; |
215 | 215 | 15 |
216 | 16 *** 11 50 $x->[18] //= undef; | |
217 | 17 *** 11 50 $x->[18] //= 0; | |
218 | 18 *** 11 50 $x->[18] //= 0; | |
219 | 19 *** 11 50 $x->[18] //= 1; | |
220 | 20 *** 11 50 $x->[18] //= 1; | |
216 | 16 *** 11 * 50 $x->[18] //= undef; | |
217 | 17 *** 11 * 50 $x->[18] //= 0; | |
218 | 18 *** 11 * 50 $x->[18] //= 0; | |
219 | 19 *** 11 * 50 $x->[18] //= 1; | |
220 | 20 *** 11 * 50 $x->[18] //= 1; | |
221 | 221 | 21 |
222 | 222 | 22 11 100 $x->[19] //= 1; |
223 | 23 *** 11 50 $x->[19] //= 1; | |
224 | 24 *** 11 50 $x->[19] //= 0; | |
225 | 25 *** 11 50 $x->[19] //= undef; | |
226 | 26 *** 11 50 $x->[19] //= 1; | |
223 | 23 *** 11 * 50 $x->[19] //= 1; | |
224 | 24 *** 11 * 50 $x->[19] //= 0; | |
225 | 25 *** 11 * 50 $x->[19] //= undef; | |
226 | 26 *** 11 * 50 $x->[19] //= 1; | |
227 | 227 | 27 |
228 | 28 *** 11 50 $x->[20] = $x->[21] // undef; | |
229 | 29 *** 11 50 $x->[20] = $x->[21] // 0; | |
230 | 30 *** 11 50 $x->[20] = $x->[21] // 0; | |
231 | 31 *** 11 50 $x->[20] = $x->[21] // 1; | |
232 | 32 *** 11 50 $x->[20] = $x->[21] // 1; | |
228 | 28 *** 11 * 50 $x->[20] = $x->[21] // undef; | |
229 | 29 *** 11 * 50 $x->[20] = $x->[21] // 0; | |
230 | 30 *** 11 * 50 $x->[20] = $x->[21] // 0; | |
231 | 31 *** 11 * 50 $x->[20] = $x->[21] // 1; | |
232 | 32 *** 11 * 50 $x->[20] = $x->[21] // 1; | |
233 | 233 | 33 |
234 | 234 | 34 11 100 $x->[22] = $x->[22] // undef; |
235 | 235 | 35 11 100 $x->[22] = $x->[22] // 0; |
236 | 36 *** 11 50 $x->[22] = $x->[22] // 0; | |
237 | 37 *** 11 50 $x->[22] = $x->[22] // 1; | |
238 | 38 *** 11 50 $x->[22] = $x->[22] // 1; | |
236 | 36 *** 11 * 50 $x->[22] = $x->[22] // 0; | |
237 | 37 *** 11 * 50 $x->[22] = $x->[22] // 1; | |
238 | 38 *** 11 * 50 $x->[22] = $x->[22] // 1; | |
239 | 239 | 39 } |
240 | 240 | 40 |
241 | 241 | 41 1; |
43 | 43 | 19 1 my $z = 0; |
44 | 44 | 20 1 $::foo = 17; |
45 | 45 | 21 |
46 | 22 *** 1 50 if ($] >= 5.009) { | |
46 | 22 *** 1 * 50 if ($] >= 5.009) { | |
47 | 47 | 23 1 $ENV{PATH} = "/bin"; |
48 | 48 | 24 1 system "pwd"; |
49 | 49 | 25 1 1 use lib "tests"; |
50 | 50 | 1 |
51 | 51 | 1 |
52 | 52 | 26 1 my $file = "cond_or.pl"; |
53 | 27 *** 1 50 unless (my $return = do $file) { | |
54 | 28 *** 0 0 die "couldn't parse $file: $@" if $@; | |
55 | 29 *** 0 0 die "couldn't do $file: $!" unless defined $return; | |
56 | 30 *** 0 0 die "couldn't run $file" unless $return; | |
53 | 27 *** 1 * 50 unless (my $return = do $file) { | |
54 | 28 *** *0 * 0 die "couldn't parse $file: $@" if $@; | |
55 | 29 *** *0 * 0 die "couldn't do $file: $!" unless defined $return; | |
56 | 30 *** *0 * 0 die "couldn't run $file" unless $return; | |
57 | 57 | 31 } |
58 | 58 | 32 } |
59 | 59 | 33 |
60 | 60 | 34 1 for my $i (0 .. 10) { |
61 | 35 *** 11 50 $y || | |
61 | 35 *** 11 * 50 $y || | |
62 | 62 | 36 $x[1]++; |
63 | 63 | 37 |
64 | 38 *** 11 50 33 $y || | |
64 | 38 *** 11 * 50 * 33 $y || | |
65 | 65 | 39 $x[0]++ || |
66 | 66 | 40 $x[1]++; |
67 | 67 | 41 |
68 | 42 *** 11 50 $x[2]++ | |
68 | 42 *** 11 * 50 $x[2]++ | |
69 | 69 | 43 unless $z; |
70 | 70 | 44 |
71 | 71 | 45 11 for (0 .. 2) { |
72 | 72 | 46 33 $x[3]++; |
73 | 73 | 47 } |
74 | 74 | 48 |
75 | 49 *** 11 50 if ($z) { | |
76 | 50 *** 0 $x[4]++; | |
75 | 49 *** 11 * 50 if ($z) { | |
76 | 50 *** *0 $x[4]++; | |
77 | 77 | 51 } else { |
78 | 78 | 52 11 $x[5]++; |
79 | 79 | 53 } |
80 | 80 | 54 |
81 | 55 *** 11 33 my $p = $y || $z; | |
82 | 56 *** 11 33 my $q = $z || $y; | |
81 | 55 *** 11 * 33 my $p = $y || $z; | |
82 | 56 *** 11 * 33 my $q = $z || $y; | |
83 | 83 | 57 11 100 my $r = $i || "qqq"; |
84 | 84 | 58 11 100 my $s = $i || []; |
85 | 85 | 59 11 my $t = $y | $z; |
86 | 60 *** 11 50 my $u = $y || 0; | |
87 | 61 *** 11 50 my $v = $y || undef; | |
88 | 62 *** 11 50 my $w = $z || 0; | |
86 | 60 *** 11 * 50 my $u = $y || 0; | |
87 | 61 *** 11 * 50 my $v = $y || undef; | |
88 | 62 *** 11 * 50 my $w = $z || 0; | |
89 | 89 | 63 |
90 | 64 *** 11 33 $p ||= $y; | |
91 | 65 *** 11 33 $p ||= $z; | |
92 | 66 *** 11 66 $x[ 6] ||= $y; | |
93 | 67 *** 11 33 $x[ 7] ||= $z; | |
90 | 64 *** 11 * 33 $p ||= $y; | |
91 | 65 *** 11 * 33 $p ||= $z; | |
92 | 66 *** 11 * 66 $x[ 6] ||= $y; | |
93 | 67 *** 11 * 33 $x[ 7] ||= $z; | |
94 | 94 | 68 11 100 $x[ 8] ||= 1; |
95 | 95 | 69 11 100 $x[ 9] ||= {}; |
96 | 96 | 70 11 100 $x[10] ||= \"foo"; |
97 | 97 | 71 11 100 $x[11] ||= \$y; |
98 | 98 | 72 11 100 $x[12] ||= \*STDIO; |
99 | 73 *** 11 66 0 $x[13] ||= sub { 1 }; | |
100 | *** 0 | |
99 | 73 *** 11 * 66 *0 $x[13] ||= sub { 1 }; | |
100 | *** *0 | |
101 | 101 | 74 11 100 $x[14] ||= *::foo{SCALAR}; |
102 | 75 *** 11 50 $x[15] ||= *STDIO{IO}; | |
102 | 75 *** 11 * 50 $x[15] ||= *STDIO{IO}; | |
103 | 103 | 76 11 100 $x[16] ||= bless {}, "XXX"; |
104 | 104 | 77 11 100 $x[17] ||= $i == 1; |
105 | 78 *** 11 33 $w ||= ref($i) eq "SCALAR"; | |
105 | 78 *** 11 * 33 $w ||= ref($i) eq "SCALAR"; | |
106 | 106 | 79 11 100 $x[18] ||= <<"EOD"; |
107 | 107 | 80 blah |
108 | 108 | 81 EOD |
109 | 82 *** 11 50 cond_dor(\@x) if exists &cond_dor; | |
110 | 83 *** 11 0 0 sub { $x[19] ||= 1 }; | |
111 | *** 0 | |
109 | 82 *** 11 * 50 cond_dor(\@x) if exists &cond_dor; | |
110 | 83 *** 11 * 0 *0 sub { $x[19] ||= 1 }; | |
111 | *** *0 | |
112 | 112 | 84 } |
113 | 113 | 85 |
114 | 114 | 86 # print join(", ", @x), "\n"; |
213 | 213 | 13 sub cond_dor { |
214 | 214 | 14 11 11 my ($x) = @_; |
215 | 215 | 15 |
216 | 16 *** 11 50 $x->[18] //= undef; | |
217 | 17 *** 11 50 $x->[18] //= 0; | |
218 | 18 *** 11 50 $x->[18] //= 0; | |
219 | 19 *** 11 50 $x->[18] //= 1; | |
220 | 20 *** 11 50 $x->[18] //= 1; | |
216 | 16 *** 11 * 50 $x->[18] //= undef; | |
217 | 17 *** 11 * 50 $x->[18] //= 0; | |
218 | 18 *** 11 * 50 $x->[18] //= 0; | |
219 | 19 *** 11 * 50 $x->[18] //= 1; | |
220 | 20 *** 11 * 50 $x->[18] //= 1; | |
221 | 221 | 21 |
222 | 222 | 22 11 100 $x->[19] //= 1; |
223 | 23 *** 11 50 $x->[19] //= 1; | |
224 | 24 *** 11 50 $x->[19] //= 0; | |
225 | 25 *** 11 50 $x->[19] //= undef; | |
226 | 26 *** 11 50 $x->[19] //= 1; | |
223 | 23 *** 11 * 50 $x->[19] //= 1; | |
224 | 24 *** 11 * 50 $x->[19] //= 0; | |
225 | 25 *** 11 * 50 $x->[19] //= undef; | |
226 | 26 *** 11 * 50 $x->[19] //= 1; | |
227 | 227 | 27 |
228 | 28 *** 11 50 $x->[20] = $x->[21] // undef; | |
229 | 29 *** 11 50 $x->[20] = $x->[21] // 0; | |
230 | 30 *** 11 50 $x->[20] = $x->[21] // 0; | |
231 | 31 *** 11 50 $x->[20] = $x->[21] // 1; | |
232 | 32 *** 11 50 $x->[20] = $x->[21] // 1; | |
228 | 28 *** 11 * 50 $x->[20] = $x->[21] // undef; | |
229 | 29 *** 11 * 50 $x->[20] = $x->[21] // 0; | |
230 | 30 *** 11 * 50 $x->[20] = $x->[21] // 0; | |
231 | 31 *** 11 * 50 $x->[20] = $x->[21] // 1; | |
232 | 32 *** 11 * 50 $x->[20] = $x->[21] // 1; | |
233 | 233 | 33 |
234 | 234 | 34 11 100 $x->[22] = $x->[22] // undef; |
235 | 235 | 35 11 100 $x->[22] = $x->[22] // 0; |
236 | 36 *** 11 50 $x->[22] = $x->[22] // 0; | |
237 | 37 *** 11 50 $x->[22] = $x->[22] // 1; | |
238 | 38 *** 11 50 $x->[22] = $x->[22] // 1; | |
236 | 36 *** 11 * 50 $x->[22] = $x->[22] // 0; | |
237 | 37 *** 11 * 50 $x->[22] = $x->[22] // 1; | |
238 | 38 *** 11 * 50 $x->[22] = $x->[22] // 1; | |
239 | 239 | 39 } |
240 | 240 | 40 |
241 | 241 | 41 1; |
43 | 43 | 19 1 my $z = 0; |
44 | 44 | 20 1 $::foo = 17; |
45 | 45 | 21 |
46 | 22 *** 1 50 if ($] >= 5.009) { | |
46 | 22 *** 1 * 50 if ($] >= 5.009) { | |
47 | 47 | 23 1 $ENV{PATH} = "/bin"; |
48 | 48 | 24 1 system "pwd"; |
49 | 49 | 25 1 1 use lib "tests"; |
50 | 50 | 1 |
51 | 51 | 1 |
52 | 52 | 26 1 my $file = "cond_or.pl"; |
53 | 27 *** 1 50 unless (my $return = do $file) { | |
54 | 28 *** 0 0 die "couldn't parse $file: $@" if $@; | |
55 | 29 *** 0 0 die "couldn't do $file: $!" unless defined $return; | |
56 | 30 *** 0 0 die "couldn't run $file" unless $return; | |
53 | 27 *** 1 * 50 unless (my $return = do $file) { | |
54 | 28 *** *0 * 0 die "couldn't parse $file: $@" if $@; | |
55 | 29 *** *0 * 0 die "couldn't do $file: $!" unless defined $return; | |
56 | 30 *** *0 * 0 die "couldn't run $file" unless $return; | |
57 | 57 | 31 } |
58 | 58 | 32 } |
59 | 59 | 33 |
60 | 60 | 34 1 for my $i (0 .. 10) { |
61 | 35 *** 11 50 $y || | |
61 | 35 *** 11 * 50 $y || | |
62 | 62 | 36 $x[1]++; |
63 | 63 | 37 |
64 | 38 *** 11 50 33 $y || | |
64 | 38 *** 11 * 50 * 33 $y || | |
65 | 65 | 39 $x[0]++ || |
66 | 66 | 40 $x[1]++; |
67 | 67 | 41 |
68 | 42 *** 11 50 $x[2]++ | |
68 | 42 *** 11 * 50 $x[2]++ | |
69 | 69 | 43 unless $z; |
70 | 70 | 44 |
71 | 71 | 45 11 for (0 .. 2) { |
72 | 72 | 46 33 $x[3]++; |
73 | 73 | 47 } |
74 | 74 | 48 |
75 | 49 *** 11 50 if ($z) { | |
76 | 50 *** 0 $x[4]++; | |
75 | 49 *** 11 * 50 if ($z) { | |
76 | 50 *** *0 $x[4]++; | |
77 | 77 | 51 } else { |
78 | 78 | 52 11 $x[5]++; |
79 | 79 | 53 } |
80 | 80 | 54 |
81 | 55 *** 11 33 my $p = $y || $z; | |
82 | 56 *** 11 33 my $q = $z || $y; | |
81 | 55 *** 11 * 33 my $p = $y || $z; | |
82 | 56 *** 11 * 33 my $q = $z || $y; | |
83 | 83 | 57 11 100 my $r = $i || "qqq"; |
84 | 58 *** 11 66 my $s = $i || []; | |
84 | 58 *** 11 * 66 my $s = $i || []; | |
85 | 85 | 59 11 my $t = $y | $z; |
86 | 60 *** 11 50 my $u = $y || 0; | |
87 | 61 *** 11 50 my $v = $y || undef; | |
88 | 62 *** 11 50 my $w = $z || 0; | |
86 | 60 *** 11 * 50 my $u = $y || 0; | |
87 | 61 *** 11 * 50 my $v = $y || undef; | |
88 | 62 *** 11 * 50 my $w = $z || 0; | |
89 | 89 | 63 |
90 | 64 *** 11 33 $p ||= $y; | |
91 | 65 *** 11 33 $p ||= $z; | |
92 | 66 *** 11 66 $x[ 6] ||= $y; | |
93 | 67 *** 11 33 $x[ 7] ||= $z; | |
90 | 64 *** 11 * 33 $p ||= $y; | |
91 | 65 *** 11 * 33 $p ||= $z; | |
92 | 66 *** 11 * 66 $x[ 6] ||= $y; | |
93 | 67 *** 11 * 33 $x[ 7] ||= $z; | |
94 | 94 | 68 11 100 $x[ 8] ||= 1; |
95 | 69 *** 11 66 $x[ 9] ||= {}; | |
95 | 69 *** 11 * 66 $x[ 9] ||= {}; | |
96 | 96 | 70 11 100 $x[10] ||= \"foo"; |
97 | 97 | 71 11 100 $x[11] ||= \$y; |
98 | 98 | 72 11 100 $x[12] ||= \*STDIO; |
99 | 73 *** 11 66 0 $x[13] ||= sub { 1 }; | |
100 | *** 0 | |
99 | 73 *** 11 * 66 *0 $x[13] ||= sub { 1 }; | |
100 | *** *0 | |
101 | 101 | 74 11 100 $x[14] ||= *::foo{SCALAR}; |
102 | 75 *** 11 50 $x[15] ||= *STDIO{IO}; | |
102 | 75 *** 11 * 50 $x[15] ||= *STDIO{IO}; | |
103 | 103 | 76 11 100 $x[16] ||= bless {}, "XXX"; |
104 | 104 | 77 11 100 $x[17] ||= $i == 1; |
105 | 78 *** 11 33 $w ||= ref($i) eq "SCALAR"; | |
105 | 78 *** 11 * 33 $w ||= ref($i) eq "SCALAR"; | |
106 | 106 | 79 11 100 $x[18] ||= <<"EOD"; |
107 | 107 | 80 blah |
108 | 108 | 81 EOD |
109 | 82 *** 11 50 cond_dor(\@x) if exists &cond_dor; | |
110 | 83 *** 11 0 0 sub { $x[19] ||= 1 }; | |
111 | *** 0 | |
109 | 82 *** 11 * 50 cond_dor(\@x) if exists &cond_dor; | |
110 | 83 *** 11 * 0 *0 sub { $x[19] ||= 1 }; | |
111 | *** *0 | |
112 | 112 | 84 } |
113 | 113 | 85 |
114 | 114 | 86 # print join(", ", @x), "\n"; |
213 | 213 | 13 sub cond_dor { |
214 | 214 | 14 11 11 my ($x) = @_; |
215 | 215 | 15 |
216 | 16 *** 11 50 $x->[18] //= undef; | |
217 | 17 *** 11 50 $x->[18] //= 0; | |
218 | 18 *** 11 50 $x->[18] //= 0; | |
219 | 19 *** 11 50 $x->[18] //= 1; | |
220 | 20 *** 11 50 $x->[18] //= 1; | |
216 | 16 *** 11 * 50 $x->[18] //= undef; | |
217 | 17 *** 11 * 50 $x->[18] //= 0; | |
218 | 18 *** 11 * 50 $x->[18] //= 0; | |
219 | 19 *** 11 * 50 $x->[18] //= 1; | |
220 | 20 *** 11 * 50 $x->[18] //= 1; | |
221 | 221 | 21 |
222 | 222 | 22 11 100 $x->[19] //= 1; |
223 | 23 *** 11 50 $x->[19] //= 1; | |
224 | 24 *** 11 50 $x->[19] //= 0; | |
225 | 25 *** 11 50 $x->[19] //= undef; | |
226 | 26 *** 11 50 $x->[19] //= 1; | |
223 | 23 *** 11 * 50 $x->[19] //= 1; | |
224 | 24 *** 11 * 50 $x->[19] //= 0; | |
225 | 25 *** 11 * 50 $x->[19] //= undef; | |
226 | 26 *** 11 * 50 $x->[19] //= 1; | |
227 | 227 | 27 |
228 | 28 *** 11 50 $x->[20] = $x->[21] // undef; | |
229 | 29 *** 11 50 $x->[20] = $x->[21] // 0; | |
230 | 30 *** 11 50 $x->[20] = $x->[21] // 0; | |
231 | 31 *** 11 50 $x->[20] = $x->[21] // 1; | |
232 | 32 *** 11 50 $x->[20] = $x->[21] // 1; | |
228 | 28 *** 11 * 50 $x->[20] = $x->[21] // undef; | |
229 | 29 *** 11 * 50 $x->[20] = $x->[21] // 0; | |
230 | 30 *** 11 * 50 $x->[20] = $x->[21] // 0; | |
231 | 31 *** 11 * 50 $x->[20] = $x->[21] // 1; | |
232 | 32 *** 11 * 50 $x->[20] = $x->[21] // 1; | |
233 | 233 | 33 |
234 | 234 | 34 11 100 $x->[22] = $x->[22] // undef; |
235 | 235 | 35 11 100 $x->[22] = $x->[22] // 0; |
236 | 36 *** 11 50 $x->[22] = $x->[22] // 0; | |
237 | 37 *** 11 50 $x->[22] = $x->[22] // 1; | |
238 | 38 *** 11 50 $x->[22] = $x->[22] // 1; | |
236 | 36 *** 11 * 50 $x->[22] = $x->[22] // 0; | |
237 | 37 *** 11 * 50 $x->[22] = $x->[22] // 1; | |
238 | 38 *** 11 * 50 $x->[22] = $x->[22] // 1; | |
239 | 239 | 39 } |
240 | 240 | 40 |
241 | 241 | 41 1; |
41 | 41 | 18 12 my $x = $y ^ $z; |
42 | 42 | 19 12 100 $x = ($y xor $z); |
43 | 43 | 20 |
44 | 21 *** 12 50 my $p = ($i xor $y); | |
45 | 22 *** 12 50 $p = ($j xor $y); | |
44 | 21 *** 12 * 50 my $p = ($i xor $y); | |
45 | 22 *** 12 * 50 $p = ($j xor $y); | |
46 | 46 | 23 12 $p ^= $y; |
47 | 47 | 24 } |
48 | 48 | 25 } |
37 | 37 | 1 |
38 | 38 | 1 |
39 | 39 | 14 |
40 | 15 *** 1 0 $SIG{__WARN__} = sub { die @_ }; | |
41 | *** 0 | |
40 | 15 *** 1 *0 $SIG{__WARN__} = sub { die @_ }; | |
41 | *** *0 | |
42 | 42 | 16 1 require COP; |
43 | 43 | |
44 | 44 |
35 | 35 | 12 |
36 | 36 | 13 sub p { |
37 | 37 | 14 2 100 2 my $x = shift || 11; |
38 | 15 *** 2 66 my $y = shift || []; | |
39 | 16 *** 2 66 my $z = shift || {}; | |
38 | 15 *** 2 * 66 my $y = shift || []; | |
39 | 16 *** 2 * 66 my $z = shift || {}; | |
40 | 40 | 17 } |
41 | 41 | 18 |
42 | 42 | 19 1 p $_, $_, $_ for 0, 1; |
38 | 38 | 1 |
39 | 39 | 14 |
40 | 40 | 15 my $xx = sub { |
41 | 16 *** 0 0 print "xx"; | |
41 | 16 *** *0 *0 print "xx"; | |
42 | 42 | 17 1 }; |
43 | 43 | 18 |
44 | 44 | 19 1 print B::Deparse->new->coderef2text($xx) |
26 | 26 | 7 # The latest version of this software should be available from my homepage: |
27 | 27 | 8 # http://www.pjcj.net |
28 | 28 | 9 |
29 | 10 *** 0 0 sub unused { 0 } | |
30 | 11 *** 0 sub empty { } | |
29 | 10 *** *0 *0 sub unused { 0 } | |
30 | 11 *** *0 sub empty { } | |
31 | 31 | 12 |
32 | 32 | 13 sub gen { |
33 | 33 | 14 4 4 my $x = shift; |
34 | 34 | 15 sub { |
35 | 35 | 16 5 5 my $y = shift; |
36 | 17 *** 5 50 return $x + $y if $y; | |
36 | 17 *** 5 * 50 return $x + $y if $y; | |
37 | 37 | 18 } |
38 | 38 | 19 4 }; |
39 | 39 | 20 |
33 | 33 | 1 |
34 | 34 | 1 |
35 | 35 | 12 |
36 | 13 *** 1 50 1 use lib -d "t" ? "t" : ".."; | |
36 | 13 *** 1 * 50 1 use lib -d "t" ? "t" : ".."; | |
37 | 37 | 1 |
38 | 38 | 1 |
39 | 39 | 14 |
49 | 49 | 22 EOS |
50 | 50 | 23 |
51 | 51 | 24 1 2 eval <<'EOS'; |
52 | *** 2 0 | |
52 | *** 2 *0 | |
53 | 53 | 2 3 |
54 | *** 0 | |
54 | *** *0 | |
55 | 55 | 3 |
56 | 56 | 25 sub f { |
57 | 57 | 26 $x++; |
30 | 30 | 9 |
31 | 31 | 10 print "E3\n"; |
32 | 32 | 11 |
33 | 12 *** 0 0 sub E3 { print "E3::E3\n" } | |
33 | 12 *** *0 *0 sub E3 { print "E3::E3\n" } | |
34 | 34 | 13 |
35 | 35 | 14 1 |
36 | 36 | |
57 | 57 | 9 |
58 | 58 | 10 print "E4\n"; |
59 | 59 | 11 |
60 | 12 *** 0 0 sub E4 { print "E4::E4\n" } | |
60 | 12 *** *0 *0 sub E4 { print "E4::E4\n" } | |
61 | 61 | 13 |
62 | 62 | 14 1 |
63 | 63 | |
86 | 86 | 1 |
87 | 87 | 1 |
88 | 88 | 11 |
89 | 12 *** 1 50 $x = shift || 0; | |
89 | 12 *** 1 * 50 $x = shift || 0; | |
90 | 90 | 13 1 print "1 - $x\n"; |
91 | 14 *** 1 50 if ($x) { eval 'use E2' } | |
92 | *** 0 | |
91 | 14 *** 1 * 50 if ($x) { eval 'use E2' } | |
92 | *** *0 | |
93 | 93 | 15 1 print "3 - $x\n"; |
94 | 16 *** 1 50 1 if ($x < 4) { eval 'use E3' } | |
94 | 16 *** 1 * 50 1 if ($x < 4) { eval 'use E3' } | |
95 | 95 | 1 |
96 | 96 | 1 |
97 | 97 | 1 |
98 | 98 | 1 |
99 | 99 | 17 1 print "4 - $x\n"; |
100 | 18 *** 1 50 1 if ($x < 6) { eval 'use E4' } | |
100 | 18 *** 1 * 50 1 if ($x < 6) { eval 'use E4' } | |
101 | 101 | 1 |
102 | 102 | 1 |
103 | 103 | 1 |
30 | 30 | 1 |
31 | 31 | 1 |
32 | 32 | 11 |
33 | 12 *** 1 50 $x = shift || 0; | |
33 | 12 *** 1 * 50 $x = shift || 0; | |
34 | 34 | 13 1 print "1 - $x\n"; |
35 | 14 *** 1 50 if ($x) { eval 'sub s1 { print "s1\n" }'; s1() } | |
36 | *** 0 | |
37 | *** 0 | |
35 | 14 *** 1 * 50 if ($x) { eval 'sub s1 { print "s1\n" }'; s1() } | |
36 | *** *0 | |
37 | *** *0 | |
38 | 38 | 15 1 print "3 - $x\n"; |
39 | 16 *** 1 50 1 if ($x < 4) { eval 'sub s2 { print "s2\n" }'; s2() } | |
39 | 16 *** 1 * 50 1 if ($x < 4) { eval 'sub s2 { print "s2\n" }'; s2() } | |
40 | 40 | 1 |
41 | 41 | 1 |
42 | 42 | 1 |
43 | 43 | 17 1 print "4 - $x\n"; |
44 | 18 *** 1 50 1 if ($x < 6) { eval 'sub s3 { print "s3\n" }'; s3() } | |
44 | 18 *** 1 * 50 1 if ($x < 6) { eval 'sub s3 { print "s3\n" }'; s3() } | |
45 | 45 | 1 |
46 | 46 | 1 |
47 | 47 | 1 |
86 | 86 | 1 |
87 | 87 | 1 |
88 | 88 | 11 |
89 | 12 *** 1 50 $x = shift || 0; | |
89 | 12 *** 1 * 50 $x = shift || 0; | |
90 | 90 | 13 1 print "1 - $x\n"; |
91 | 14 *** 1 50 if (!$x) { | |
91 | 14 *** 1 * 50 if (!$x) { | |
92 | 92 | 15 1 1 eval "use E2"; eval "use E3"; |
93 | 93 | 1 1 |
94 | 94 | 1 |
100 | 100 | 16 1 E2::E2(); E3::E3(); |
101 | 101 | 1 |
102 | 102 | 17 } else { |
103 | 18 *** 0 eval "use E3"; eval "use E4"; | |
104 | *** 0 | |
105 | 19 *** 0 E3::E3(); E4::E4(); | |
106 | *** 0 | |
103 | 18 *** *0 eval "use E3"; eval "use E4"; | |
104 | *** *0 | |
105 | 19 *** *0 E3::E3(); E4::E4(); | |
106 | *** *0 | |
107 | 107 | 20 } |
108 | 108 | 21 1 print "2 - $x\n"; |
109 | 109 |
36 | 36 | 13 1 2 eval "eval q[ sub config { {} } ]"; |
37 | 37 | 2 |
38 | 38 | 14 |
39 | 15 *** 1 50 my $e1 = config() || {}; | |
40 | 16 *** 1 50 my $e2 = config()->{mail} || {}; | |
39 | 15 *** 1 * 50 my $e1 = config() || {}; | |
40 | 16 *** 1 * 50 my $e2 = config()->{mail} || {}; | |
41 | 41 | |
42 | 42 | |
43 | 43 | Conditions |
36 | 36 | 13 1 2 eval "eval q[ sub config { {} } ]"; |
37 | 37 | 2 |
38 | 38 | 14 |
39 | 15 *** 1 33 my $e1 = config() || {}; | |
40 | 16 *** 1 33 my $e2 = config()->{mail} || {}; | |
39 | 15 *** 1 * 33 my $e1 = config() || {}; | |
40 | 16 *** 1 * 33 my $e2 = config()->{mail} || {}; | |
41 | 41 | |
42 | 42 | |
43 | 43 | Conditions |
27 | 27 | 4 |
28 | 28 | 5 1 my $i = 1; |
29 | 29 | 6 |
30 | 7 *** 1 50 if ($i == 2) { | |
31 | 8 *** 0 print STDERR "hello\n"; | |
30 | 7 *** 1 * 50 if ($i == 2) { | |
31 | 8 *** *0 print STDERR "hello\n"; | |
32 | 32 | 9 } else { |
33 | 33 | 10 1 print STDERR "goodbye\n"; |
34 | 34 | 11 } |
35 | 35 | 12 |
36 | 36 | 13 1 eval { |
37 | 14 *** 1 50 if ($i == 2) { | |
38 | 15 *** 0 print STDERR "hello\n"; | |
37 | 14 *** 1 * 50 if ($i == 2) { | |
38 | 15 *** *0 print STDERR "hello\n"; | |
39 | 39 | 16 } else { |
40 | 40 | 17 1 print STDERR "goodbye\n"; |
41 | 41 | 18 } |
51 | 51 | 28 |
52 | 52 | 29 sub ev { |
53 | 53 | 30 1 1 eval { |
54 | 31 *** 1 50 if ($i == 2) { | |
55 | 32 *** 0 print STDERR "hello\n"; | |
54 | 31 *** 1 * 50 if ($i == 2) { | |
55 | 32 *** *0 print STDERR "hello\n"; | |
56 | 56 | 33 } else { |
57 | 57 | 34 1 print STDERR "goodbye\n"; |
58 | 58 | 35 } |
49 | 49 | 9 |
50 | 50 | 10 print "E2\n"; |
51 | 51 | 11 |
52 | 12 *** 0 0 sub E2 { print "E2::E2\n" } | |
52 | 12 *** *0 *0 sub E2 { print "E2::E2\n" } | |
53 | 53 | 13 |
54 | 54 | 14 1 |
55 | 55 | |
76 | 76 | 9 |
77 | 77 | 10 print "E3\n"; |
78 | 78 | 11 |
79 | 12 *** 0 0 sub E3 { print "E3::E3\n" } | |
79 | 12 *** *0 *0 sub E3 { print "E3::E3\n" } | |
80 | 80 | 13 |
81 | 81 | 14 1 |
82 | 82 | |
103 | 103 | 9 |
104 | 104 | 10 print "E4\n"; |
105 | 105 | 11 |
106 | 12 *** 0 0 sub E4 { print "E4::E4\n" } | |
106 | 12 *** *0 *0 sub E4 { print "E4::E4\n" } | |
107 | 107 | 13 |
108 | 108 | 14 1 |
109 | 109 |
30 | 30 | 11 |
31 | 31 | 12 1 exec "echo foo"; |
32 | 32 | 13 |
33 | 14 *** 0 die "Unreachable"; | |
33 | 14 *** *0 die "Unreachable"; | |
34 | 34 | |
35 | 35 |
29 | 29 | 10 # __COVER__ skip_test $^O eq "MSWin32" |
30 | 30 | 11 # __COVER__ skip_reason Fork uses threads on Windows |
31 | 31 | 12 |
32 | 13 *** 1 50 die unless defined ($pid = fork); | |
32 | 13 *** 1 * 50 die unless defined ($pid = fork); | |
33 | 33 | 14 |
34 | 15 *** 1 50 if ($pid) { | |
34 | 15 *** 1 * 50 if ($pid) { | |
35 | 35 | 16 1 wait; |
36 | 36 | 17 } else { |
37 | 18 *** 0 0 local *Devel::Cover::_report = sub { die "Badness happened!" }; | |
38 | *** 0 | |
39 | 19 *** 0 exec "echo We want to be able to see this."; | |
37 | 18 *** *0 *0 local *Devel::Cover::_report = sub { die "Badness happened!" }; | |
38 | *** *0 | |
39 | 19 *** *0 exec "echo We want to be able to see this."; | |
40 | 40 | 20 } |
41 | 41 | |
42 | 42 |
37 | 37 | 12 |
38 | 38 | 13 2 $x = 1; |
39 | 39 | 14 |
40 | 15 *** 2 50 die unless defined ($pid = fork); | |
40 | 15 *** 2 * 50 die unless defined ($pid = fork); | |
41 | 41 | 16 |
42 | 42 | 17 2 100 if ($pid) { |
43 | 43 | 18 1 $x = 2; |
37 | 37 | 14 |
38 | 38 | 15 1 $x = 0; |
39 | 39 | 16 |
40 | 17 *** 1 50 if ($x) { | |
41 | 18 *** 0 $p++ | |
40 | 17 *** 1 * 50 if ($x) { | |
41 | 18 *** *0 $p++ | |
42 | 42 | 19 } |
43 | 43 | 20 |
44 | 21 *** 1 50 unless ($x) { | |
44 | 21 *** 1 * 50 unless ($x) { | |
45 | 45 | 22 1 $q++ |
46 | 46 | 23 } |
47 | 47 | 24 |
48 | 48 | 25 1 $x = 1; |
49 | 49 | 26 |
50 | 27 *** 1 50 if ($x) { | |
50 | 27 *** 1 * 50 if ($x) { | |
51 | 51 | 28 1 $r++ |
52 | 52 | 29 } |
53 | 53 | 30 |
54 | 31 *** 1 50 if ($x) { | |
54 | 31 *** 1 * 50 if ($x) { | |
55 | 55 | 32 1 $r++ |
56 | 56 | 33 } else { |
57 | 34 *** 0 $s++ | |
57 | 34 *** *0 $s++ | |
58 | 58 | 35 } |
59 | 59 | 36 |
60 | 37 *** 1 50 unless ($x) { | |
61 | 38 *** 0 $s++ | |
60 | 37 *** 1 * 50 unless ($x) { | |
61 | 38 *** *0 $s++ | |
62 | 62 | 39 } |
63 | 63 | |
64 | 64 |
31 | 31 | 11 $y++; |
32 | 32 | 12 |
33 | 33 | 13 sub _aa { |
34 | 14 *** 0 0 $y++; | |
35 | 15 *** 0 die; | |
36 | 16 *** 0 die; | |
34 | 14 *** *0 *0 $y++; | |
35 | 15 *** *0 die; | |
36 | 16 *** *0 die; | |
37 | 37 | 17 } |
38 | 38 | 18 |
39 | 39 | 19 sub xx { |
40 | 20 *** 0 0 $y++; | |
41 | 21 *** 0 die; | |
40 | 20 *** *0 *0 $y++; | |
41 | 21 *** *0 die; | |
42 | 42 | 22 } |
43 | 43 | 23 |
44 | 44 | 24 sub yy { |
45 | 25 *** 0 0 $y++; | |
45 | 25 *** *0 *0 $y++; | |
46 | 46 | 26 } |
47 | 47 | 27 |
48 | 48 | 28 sub zz { |
109 | 109 | 24 } |
110 | 110 | 25 |
111 | 111 | 26 1 for (0 .. 10) { |
112 | 27 *** 11 50 if (time) { | |
112 | 27 *** 11 * 50 if (time) { | |
113 | 113 | 28 11 xx(0); |
114 | 114 | 29 } else { |
115 | 30 *** 0 $x[1]++; | |
115 | 30 *** *0 $x[1]++; | |
116 | 116 | 31 } |
117 | 117 | 32 } |
118 | 118 |
31 | 31 | 11 $y++; |
32 | 32 | 12 |
33 | 33 | 13 sub _aa { |
34 | 14 *** 0 0 $y++; | |
35 | 15 *** 0 die; | |
36 | 16 *** 0 die; | |
34 | 14 *** *0 *0 $y++; | |
35 | 15 *** *0 die; | |
36 | 16 *** *0 die; | |
37 | 37 | 17 } |
38 | 38 | 18 |
39 | 39 | 19 sub _xx { |
40 | 20 *** 0 0 $y++; | |
41 | 21 *** 0 die; | |
40 | 20 *** *0 *0 $y++; | |
41 | 21 *** *0 die; | |
42 | 42 | 22 } |
43 | 43 | 23 |
44 | 44 | 24 sub yy { |
45 | 25 *** 0 0 $y++; | |
45 | 25 *** *0 *0 $y++; | |
46 | 46 | 26 } |
47 | 47 | 27 |
48 | 48 | 28 sub zz { |
109 | 109 | 24 } |
110 | 110 | 25 |
111 | 111 | 26 1 for (0 .. 10) { |
112 | 27 *** 11 50 if (time) { | |
112 | 27 *** 11 * 50 if (time) { | |
113 | 113 | 28 11 xx(0); |
114 | 114 | 29 } else { |
115 | 30 *** 0 $x[1]++; | |
115 | 30 *** *0 $x[1]++; | |
116 | 116 | 31 } |
117 | 117 | 32 } |
118 | 118 |
51 | 51 | 24 } |
52 | 52 | 25 |
53 | 53 | 26 1 for (0 .. 10) { |
54 | 27 *** 11 50 if (time) { | |
54 | 27 *** 11 * 50 if (time) { | |
55 | 55 | 28 11 xx(0); |
56 | 56 | 29 } else { |
57 | 30 *** 0 $x[1]++; | |
57 | 30 *** *0 $x[1]++; | |
58 | 58 | 31 } |
59 | 59 | 32 } |
60 | 60 | 33 |
64 | 64 | 37 1 $y++; |
65 | 65 | 38 |
66 | 66 | 39 sub _aa { |
67 | 40 *** 0 0 $y++; | |
68 | 41 *** 0 die; | |
69 | 42 *** 0 die; | |
67 | 40 *** *0 *0 $y++; | |
68 | 41 *** *0 die; | |
69 | 42 *** *0 die; | |
70 | 70 | 43 } |
71 | 71 | 44 |
72 | 72 | 45 sub xx { |
73 | 46 *** 0 0 $y++; | |
74 | 47 *** 0 die; | |
73 | 46 *** *0 *0 $y++; | |
74 | 47 *** *0 die; | |
75 | 75 | 48 } |
76 | 76 | 49 |
77 | 77 | 50 sub yy { |
78 | 51 *** 0 0 $y++; | |
78 | 51 *** *0 *0 $y++; | |
79 | 79 | 52 } |
80 | 80 | 53 |
81 | 81 | 54 sub zz { |
53 | 53 | 28 |
54 | 54 | 29 sub wagh { |
55 | 55 | 30 2 2 my ( $self ) = @_; |
56 | 31 *** 2 50 my $x = $self || 0; | |
56 | 31 *** 2 * 50 my $x = $self || 0; | |
57 | 57 | 32 2 100 return $self->meep->{marp} || 0; |
58 | 58 | 33 # return $self || 0; |
59 | 59 | 34 } |
28 | 28 | 9 |
29 | 29 | 10 package Foo; |
30 | 30 | 11 use overload |
31 | 12 *** 0 0 '""' => sub { shift->render}, | |
31 | 12 *** *0 *0 '""' => sub { shift->render}, | |
32 | 32 | 13 1 1 bool => sub { die; 1 }; |
33 | *** 1 0 | |
33 | *** 1 *0 | |
34 | 34 | 1 |
35 | *** 0 | |
36 | *** 0 | |
35 | *** *0 | |
36 | *** *0 | |
37 | 37 | 14 |
38 | 38 | 15 sub render { |
39 | 16 *** 0 0 "foo"; | |
39 | 16 *** *0 *0 "foo"; | |
40 | 40 | 17 } |
41 | 41 | 18 |
42 | 42 | 19 1 my $foo = 1; |
43 | 20 *** 1 50 bless {}, 'Foo' if $foo; | |
43 | 20 *** 1 * 50 bless {}, 'Foo' if $foo; | |
44 | 44 | 21 |
45 | 45 | 22 1; |
46 | 46 |
34 | 34 | 1 |
35 | 35 | 12 |
36 | 36 | 13 { |
37 | 14 *** 0 package Cat; | |
37 | 14 *** *0 package Cat; | |
38 | 38 | 15 |
39 | 39 | 16 1 1 use overload (bool => "meh"); |
40 | 40 | 1 |
34 | 34 | 1 |
35 | 35 | 12 |
36 | 36 | 13 { |
37 | 14 *** 0 package Cat; | |
37 | 14 *** *0 package Cat; | |
38 | 38 | 15 |
39 | 39 | 16 1 1 use overload (bool => "meh"); |
40 | 40 | 1 |
45 | 45 | 23 |
46 | 46 | 24 1 my $seven = new two_face ("vii", 7); |
47 | 47 | 25 1 printf "seven=$seven, seven=%d, eight=%d\n", $seven, $seven+1; |
48 | 26 *** 1 50 print "seven contains `i'\n" if $seven =~ /i/; | |
48 | 26 *** 1 * 50 print "seven contains `i'\n" if $seven =~ /i/; | |
49 | 49 | |
50 | 50 | |
51 | 51 | Branches |
26 | 26 | 1 |
27 | 27 | 1 |
28 | 28 | 5 |
29 | 6 *** 1 50 if (my @x = 'foo' =~ m/(.)/) { | |
29 | 6 *** 1 * 50 if (my @x = 'foo' =~ m/(.)/) { | |
30 | 30 | 7 } else { |
31 | 31 | 8 } |
32 | 32 |
26 | 26 | 1 |
27 | 27 | 1 |
28 | 28 | 5 |
29 | 6 *** 1 50 if (my @x = 'foo' =~ m/(.)/) { | |
29 | 6 *** 1 * 50 if (my @x = 'foo' =~ m/(.)/) { | |
30 | 30 | 7 } else { |
31 | 31 | 8 } |
32 | 32 |
26 | 26 | 1 |
27 | 27 | 1 |
28 | 28 | 5 |
29 | 6 *** 1 50 if (my @x = 'foo' =~ m/(.)/) { | |
29 | 6 *** 1 * 50 if (my @x = 'foo' =~ m/(.)/) { | |
30 | 30 | 7 } else { |
31 | 31 | 8 } |
32 | 32 |
29 | 29 | 9 |
30 | 30 | 10 print "E2\n"; |
31 | 31 | 11 |
32 | 12 *** 0 0 sub E2 { print "E2::E2\n" } | |
32 | 12 *** *0 *0 sub E2 { print "E2::E2\n" } | |
33 | 33 | 13 |
34 | 34 | 14 1 |
35 | 35 | |
54 | 54 | 7 # The latest version of this software should be available from my homepage: |
55 | 55 | 8 # http://www.pjcj.net |
56 | 56 | 9 |
57 | 10 *** 1 50 1 use lib -d "t" ? "." : ".."; | |
57 | 10 *** 1 * 50 1 use lib -d "t" ? "." : ".."; | |
58 | 58 | 1 |
59 | 59 | 1 |
60 | 60 | 11 1 1 use File::Spec; |
49 | 49 | 19 } |
50 | 50 | 20 |
51 | 51 | 21 1 my $x = xx(3, 4, 5); |
52 | 22 *** 1 50 die unless $x == 18; | |
52 | 22 *** 1 * 50 die unless $x == 18; | |
53 | 53 | |
54 | 54 | |
55 | 55 | Branches |
29 | 29 | 10 sub main { |
30 | 30 | 11 1 1 my ($debug) = @_; |
31 | 31 | 12 1 print "main\n"; |
32 | 13 *** 1 50 print "debug1\n" if $debug; | |
33 | 14 *** 1 50 if ($debug) { | |
34 | 15 *** 0 print "debug2\n"; | |
32 | 13 *** 1 * 50 print "debug1\n" if $debug; | |
33 | 14 *** 1 * 50 if ($debug) { | |
34 | 15 *** *0 print "debug2\n"; | |
35 | 35 | 16 } |
36 | 36 | 17 } |
37 | 37 | 18 |
33 | 33 | 12 } |
34 | 34 | 13 |
35 | 35 | 14 sub forwards { |
36 | 15 *** 0 0 return $a cmp $b; | |
36 | 15 *** *0 *0 return $a cmp $b; | |
37 | 37 | 16 } |
38 | 38 | 17 |
39 | 39 | 18 sub GetAlgorithm { |
38 | 38 | 15 1 my $y = 1; |
39 | 39 | 16 |
40 | 40 | 17 1 for (0 .. 10) { |
41 | 18 *** 11 50 $y && | |
41 | 18 *** 11 * 50 $y && | |
42 | 42 | 19 $x[1]++; |
43 | 43 | 20 |
44 | 21 *** 11 100 66 $y && | |
44 | 21 *** 11 100 * 66 $y && | |
45 | 45 | 22 $x[0]++ && |
46 | 46 | 23 $x[1]++; |
47 | 47 | 24 |
48 | 25 *** 11 50 $x[2]++ | |
48 | 25 *** 11 * 50 $x[2]++ | |
49 | 49 | 26 if $y; |
50 | 50 | 27 |
51 | 51 | 28 11 for (0 .. 2) { |
52 | 52 | 29 33 $x[3]++; |
53 | 53 | 30 } |
54 | 54 | 31 |
55 | 32 *** 11 50 if ($y) { | |
55 | 32 *** 11 * 50 if ($y) { | |
56 | 56 | 33 11 $x[4]++; |
57 | 57 | 34 } else { |
58 | 35 *** 0 $x[5]++; | |
58 | 35 *** *0 $x[5]++; | |
59 | 59 | 36 } |
60 | 60 | 37 } |
61 | 61 | 38 |
41 | 41 | 18 |
42 | 42 | 19 1 for (0 .. 10) { |
43 | 43 | 20 time && |
44 | 21 *** 11 50 $x[1]++; | |
44 | 21 *** 11 * 50 $x[1]++; | |
45 | 45 | 22 |
46 | 23 *** 11 50 $x[2]++ | |
46 | 23 *** 11 * 50 $x[2]++ | |
47 | 47 | 24 if time; |
48 | 48 | 25 |
49 | 49 | 26 11 for (0 .. 2) { |
50 | 50 | 27 33 $x[3]++; |
51 | 51 | 28 } |
52 | 52 | 29 |
53 | 30 *** 11 50 if (time) { | |
53 | 30 *** 11 * 50 if (time) { | |
54 | 54 | 31 11 xx(4); |
55 | 55 | 32 } else { |
56 | 33 *** 0 $x[5]++; | |
56 | 33 *** *0 $x[5]++; | |
57 | 57 | 34 } |
58 | 58 | 35 } |
59 | 59 |
0 | Reading database from ... | |
1 | ||
2 | ||
3 | ----------------------- ------ ------ ------ ------ ------ | |
4 | File stmt bran cond sub total | |
5 | ----------------------- ------ ------ ------ ------ ------ | |
6 | tests/uncoverable_error 82.3 62.5 83.3 100.0 78.7 | |
7 | Total 82.3 62.5 83.3 100.0 78.7 | |
8 | ----------------------- ------ ------ ------ ------ ------ | |
9 | ||
10 | ||
11 | Run: ... | |
12 | Perl version: ... | |
13 | OS: ... | |
14 | Start: ... | |
15 | Finish: ... | |
16 | ||
17 | tests/uncoverable_error | |
18 | ||
19 | line err stmt bran cond sub code | |
20 | 1 #!/usr/bin/perl | |
21 | 2 | |
22 | 3 # Copyright 2023, Paul Johnson (paul@pjcj.net) | |
23 | 4 | |
24 | 5 # This software is free. It is licensed under the same terms as Perl itself. | |
25 | 6 | |
26 | 7 # The latest version of this software should be available from my homepage: | |
27 | 8 # http://www.pjcj.net | |
28 | 9 | |
29 | 10 sub usub { | |
30 | 11 # uncoverable subroutine class:ignore_covered_err | |
31 | 12 # uncoverable statement class:ignore_covered_err | |
32 | 13 -1 -1 my $x = 1; | |
33 | 14 } | |
34 | 15 | |
35 | 16 sub main { | |
36 | 17 1 1 my $x = 1; | |
37 | 18 # uncoverable branch false class:ignore_covered_err | |
38 | 19 # uncoverable branch true | |
39 | 20 1 - 50 if ($x > 1) { | |
40 | 21 *** *0 $x = 0; | |
41 | 22 # uncoverable statement class:ignore_covered_err | |
42 | 23 -0 $x = 2; | |
43 | 24 *** *0 * 0 if ($x > 3) { | |
44 | 25 *** *0 $x = 4; | |
45 | 26 } | |
46 | 27 } | |
47 | 28 | |
48 | 29 1 my $y = 0; | |
49 | 30 # uncoverable branch true | |
50 | 31 # uncoverable condition left | |
51 | 32 # uncoverable condition right class:ignore_covered_err | |
52 | 33 # uncoverable condition false | |
53 | 34 1 - 50 - 33 if ($x > 0 && $y > 0) { | |
54 | 35 # uncoverable statement | |
55 | 36 -0 $y = 1; | |
56 | 37 } | |
57 | 38 | |
58 | 39 1 while ($y < 4) { | |
59 | 40 # uncoverable branch false | |
60 | 41 # uncoverable condition left | |
61 | 42 # uncoverable condition right | |
62 | 43 *** 2 *-100 *- 66 if ($x > 0 && $y > 0) { | |
63 | 44 1 $y = 4; | |
64 | 45 } else { | |
65 | 46 1 $y++; | |
66 | 47 } | |
67 | 48 } | |
68 | 49 | |
69 | 50 # uncoverable statement class:ignore_covered_err | |
70 | 51 -1 $x = 3; | |
71 | 52 1 usub; | |
72 | 53 } | |
73 | 54 | |
74 | 55 1 main | |
75 | ||
76 | ||
77 | Branches | |
78 | -------- | |
79 | ||
80 | line err % true false branch | |
81 | ----- --- ------ ------ ------ ------ | |
82 | 20 - 50 -0 -1 if ($x > 1) | |
83 | 24 *** 0 0 0 if ($x > 3) | |
84 | 34 - 50 -0 1 if ($x > 0 and $y > 0) | |
85 | 43 *** -100 1 -1 if ($x > 0 and $y > 0) { } | |
86 | ||
87 | ||
88 | Conditions | |
89 | ---------- | |
90 | ||
91 | and 3 conditions | |
92 | ||
93 | line err % !l l&&!r l&&r expr | |
94 | ----- --- ------ ------ ------ ------ ---- | |
95 | 34 - 33 -0 -1 -0 $x > 0 and $y > 0 | |
96 | 43 *** - 66 -0 -1 1 $x > 0 and $y > 0 | |
97 | ||
98 | ||
99 | Covered Subroutines | |
100 | ------------------- | |
101 | ||
102 | Subroutine Count Location | |
103 | ---------- ----- -------------------------- | |
104 | main 1 tests/uncoverable_error:17 | |
105 | usub -1 tests/uncoverable_error:13 | |
106 | ||
107 |
0 | Reading database from ... | |
1 | ||
2 | ||
3 | ------------------------------ ------ ------ ------ ------ ------ | |
4 | File stmt bran cond sub total | |
5 | ------------------------------ ------ ------ ------ ------ ------ | |
6 | tests/uncoverable_error_ignore 82.3 75.0 66.6 100.0 78.7 | |
7 | Total 82.3 75.0 66.6 100.0 78.7 | |
8 | ------------------------------ ------ ------ ------ ------ ------ | |
9 | ||
10 | ||
11 | Run: ... | |
12 | Perl version: ... | |
13 | OS: ... | |
14 | Start: ... | |
15 | Finish: ... | |
16 | ||
17 | tests/uncoverable_error_ignore | |
18 | ||
19 | line err stmt bran cond sub code | |
20 | 1 #!/usr/bin/perl | |
21 | 2 | |
22 | 3 # Copyright 2023, Paul Johnson (paul@pjcj.net) | |
23 | 4 | |
24 | 5 # This software is free. It is licensed under the same terms as Perl itself. | |
25 | 6 | |
26 | 7 # The latest version of this software should be available from my homepage: | |
27 | 8 # http://www.pjcj.net | |
28 | 9 | |
29 | 10 # __COVER__ cover_parameters -ignore_covered_err | |
30 | 11 | |
31 | 12 sub usub { | |
32 | 13 # uncoverable subroutine | |
33 | 14 # uncoverable statement | |
34 | 15 -1 -1 my $x = 1; | |
35 | 16 } | |
36 | 17 | |
37 | 18 sub main { | |
38 | 19 1 1 my $x = 1; | |
39 | 20 # uncoverable branch false | |
40 | 21 # uncoverable branch true | |
41 | 22 1 - 50 if ($x > 1) { | |
42 | 23 *** *0 $x = 0; | |
43 | 24 # uncoverable statement | |
44 | 25 -0 $x = 2; | |
45 | 26 *** *0 * 0 if ($x > 3) { | |
46 | 27 *** *0 $x = 4; | |
47 | 28 } | |
48 | 29 } | |
49 | 30 | |
50 | 31 1 my $y = 0; | |
51 | 32 # uncoverable branch true | |
52 | 33 # uncoverable condition right | |
53 | 34 *** 1 - 50 *- 33 if ($x > 0 && $y > 0) { | |
54 | 35 # uncoverable statement | |
55 | 36 -0 $y = 1; | |
56 | 37 } | |
57 | 38 | |
58 | 39 1 while ($y < 4) { | |
59 | 40 # uncoverable branch false | |
60 | 41 # uncoverable condition left | |
61 | 42 # uncoverable condition right | |
62 | 43 2 -100 - 66 if ($x > 0 && $y > 0) { | |
63 | 44 1 $y = 4; | |
64 | 45 } else { | |
65 | 46 1 $y++; | |
66 | 47 } | |
67 | 48 } | |
68 | 49 | |
69 | 50 # uncoverable statement | |
70 | 51 -1 $x = 3; | |
71 | 52 1 usub; | |
72 | 53 } | |
73 | 54 | |
74 | 55 1 main | |
75 | ||
76 | ||
77 | Branches | |
78 | -------- | |
79 | ||
80 | line err % true false branch | |
81 | ----- --- ------ ------ ------ ------ | |
82 | 22 - 50 -0 -1 if ($x > 1) | |
83 | 26 *** 0 0 0 if ($x > 3) | |
84 | 34 - 50 -0 1 if ($x > 0 and $y > 0) | |
85 | 43 -100 1 -1 if ($x > 0 and $y > 0) { } | |
86 | ||
87 | ||
88 | Conditions | |
89 | ---------- | |
90 | ||
91 | and 3 conditions | |
92 | ||
93 | line err % !l l&&!r l&&r expr | |
94 | ----- --- ------ ------ ------ ------ ---- | |
95 | 34 *** - 33 0 -1 0 $x > 0 and $y > 0 | |
96 | 43 - 66 -0 -1 1 $x > 0 and $y > 0 | |
97 | ||
98 | ||
99 | Covered Subroutines | |
100 | ------------------- | |
101 | ||
102 | Subroutine Count Location | |
103 | ---------- ----- --------------------------------- | |
104 | main 1 tests/uncoverable_error_ignore:19 | |
105 | usub -1 tests/uncoverable_error_ignore:15 | |
106 | ||
107 |
0 | #!/usr/bin/perl | |
1 | ||
2 | # Copyright 2023, Paul Johnson (paul@pjcj.net) | |
3 | ||
4 | # This software is free. It is licensed under the same terms as Perl itself. | |
5 | ||
6 | # The latest version of this software should be available from my homepage: | |
7 | # http://www.pjcj.net | |
8 | ||
9 | sub usub { | |
10 | # uncoverable subroutine class:ignore_covered_err | |
11 | # uncoverable statement class:ignore_covered_err | |
12 | my $x = 1; | |
13 | } | |
14 | ||
15 | sub main { | |
16 | my $x = 1; | |
17 | # uncoverable branch false class:ignore_covered_err | |
18 | # uncoverable branch true | |
19 | if ($x > 1) { | |
20 | $x = 0; | |
21 | # uncoverable statement class:ignore_covered_err | |
22 | $x = 2; | |
23 | if ($x > 3) { | |
24 | $x = 4; | |
25 | } | |
26 | } | |
27 | ||
28 | my $y = 0; | |
29 | # uncoverable branch true | |
30 | # uncoverable condition left | |
31 | # uncoverable condition right class:ignore_covered_err | |
32 | # uncoverable condition false | |
33 | if ($x > 0 && $y > 0) { | |
34 | # uncoverable statement | |
35 | $y = 1; | |
36 | } | |
37 | ||
38 | while ($y < 4) { | |
39 | # uncoverable branch false | |
40 | # uncoverable condition left | |
41 | # uncoverable condition right | |
42 | if ($x > 0 && $y > 0) { | |
43 | $y = 4; | |
44 | } else { | |
45 | $y++; | |
46 | } | |
47 | } | |
48 | ||
49 | # uncoverable statement class:ignore_covered_err | |
50 | $x = 3; | |
51 | usub; | |
52 | } | |
53 | ||
54 | main |
0 | #!/usr/bin/perl | |
1 | ||
2 | # Copyright 2023, Paul Johnson (paul@pjcj.net) | |
3 | ||
4 | # This software is free. It is licensed under the same terms as Perl itself. | |
5 | ||
6 | # The latest version of this software should be available from my homepage: | |
7 | # http://www.pjcj.net | |
8 | ||
9 | # __COVER__ cover_parameters -ignore_covered_err | |
10 | ||
11 | sub usub { | |
12 | # uncoverable subroutine | |
13 | # uncoverable statement | |
14 | my $x = 1; | |
15 | } | |
16 | ||
17 | sub main { | |
18 | my $x = 1; | |
19 | # uncoverable branch false | |
20 | # uncoverable branch true | |
21 | if ($x > 1) { | |
22 | $x = 0; | |
23 | # uncoverable statement | |
24 | $x = 2; | |
25 | if ($x > 3) { | |
26 | $x = 4; | |
27 | } | |
28 | } | |
29 | ||
30 | my $y = 0; | |
31 | # uncoverable branch true | |
32 | # uncoverable condition right | |
33 | if ($x > 0 && $y > 0) { | |
34 | # uncoverable statement | |
35 | $y = 1; | |
36 | } | |
37 | ||
38 | while ($y < 4) { | |
39 | # uncoverable branch false | |
40 | # uncoverable condition left | |
41 | # uncoverable condition right | |
42 | if ($x > 0 && $y > 0) { | |
43 | $y = 4; | |
44 | } else { | |
45 | $y++; | |
46 | } | |
47 | } | |
48 | ||
49 | # uncoverable statement | |
50 | $x = 3; | |
51 | usub; | |
52 | } | |
53 | ||
54 | main |