| 1 |
#!/usr/bin/perl |
| 2 |
|
| 3 |
# Copyright 2004-2026, Paul Johnson ([email protected]) |
| 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 |
# https://pjcj.net |
| 9 |
|
| 10 |
# __COVER__ uncoverable_file tests/.uncoverable |
| 11 |
|
| 12 |
my $x = 1; |
| 13 |
my $y = 1; |
| 14 |
|
| 15 |
# uncoverable branch true |
| 16 |
# uncoverable condition left |
| 17 |
# uncoverable condition false |
| 18 |
if ($x && !$y) { |
| 19 |
$x++; # uncoverable statement |
| 20 |
# uncoverable statement |
| 21 |
z(); |
| 22 |
} |
| 23 |
|
| 24 |
# uncoverable branch true |
| 25 |
# uncoverable condition right |
| 26 |
# uncoverable condition false |
| 27 |
if (!$x && $y) { |
| 28 |
# uncoverable statement count:1 |
| 29 |
# uncoverable statement count:2 |
| 30 |
b(); b(); |
| 31 |
|
| 32 |
# uncoverable statement count:1,2 |
| 33 |
b(); b(); |
| 34 |
|
| 35 |
# uncoverable statement count:1..4 |
| 36 |
b(); b(); b(); b(); |
| 37 |
|
| 38 |
# uncoverable statement count:1,2,3..4,5..7,8,9,10..11,12 |
| 39 |
b(); b(); b(); b(); b(); b(); b(); b(); b(); b(); b(); b(); |
| 40 |
} |
| 41 |
|
| 42 |
sub z { |
| 43 |
# uncoverable subroutine |
| 44 |
$y++; # uncoverable statement |
| 45 |
} |
| 46 |
|
| 47 |
# uncoverable branch false count:1 |
| 48 |
# uncoverable branch true count:2 |
| 49 |
# uncoverable branch false count:2 |
| 50 |
# uncoverable condition left count:1,2 |
| 51 |
# uncoverable condition right count:1..2 |
| 52 |
# uncoverable condition true count:2 |
| 53 |
# uncoverable condition false count:2 |
| 54 |
if ($x > 0 && $y > 0) { |
| 55 |
$y++; |
| 56 |
} elsif ($x < 2 && $y < 0) { |
| 57 |
$y++; # uncoverable statement |
| 58 |
} else { |
| 59 |
$y++; # uncoverable statement |
| 60 |
} |
| 61 |
|
| 62 |
# uncoverable statement |
| 63 |
# uncoverable subroutine |