Skip to content

Commit

Permalink
update overload_bool to drop pre-5.12 support
Browse files Browse the repository at this point in the history
  • Loading branch information
mohawk2 committed Nov 20, 2024
1 parent 58ce51f commit 7ae5300
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
25 changes: 15 additions & 10 deletions test_output/cover/overload_bool.5.012000
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Reading database from ...
------------------- ------ ------ ------ ------ ------
File stmt bran cond sub total
------------------- ------ ------ ------ ------ ------
tests/overload_bool 66.6 50.0 n/a 25.0 54.5
Total 66.6 50.0 n/a 25.0 54.5
tests/overload_bool 60.0 50.0 50.0 25.0 50.0
Total 60.0 50.0 50.0 25.0 50.0
------------------- ------ ------ ------ ------ ------


Expand Down Expand Up @@ -43,12 +43,9 @@ line err stmt bran cond sub code
19 1 my $foo = 1;
20 *** 1 * 50 my $boolobj = bless {}, 'Foo' if $foo;
21
22 *** 1 * 50 if ($] >= 5.010) {
23 1 eval '$boolobj //= 5;';
24 *** 1 * 50 die if $@;
25 }
26
27 1;
22 *** 1 * 50 $boolobj //= 5;
23
24 1;


Branches
Expand All @@ -57,8 +54,16 @@ Branches
line err % true false branch
----- --- ------ ------ ------ ------
20 *** 50 1 0 if $foo
22 *** 50 1 0 if ($] >= "5.01")
24 *** 50 0 1 if $@


Conditions
----------

or 2 conditions

line err % l !l expr
----- --- ------ ------ ------ ----
22 *** 50 1 0 $boolobj //= 5


Covered Subroutines
Expand Down
5 changes: 1 addition & 4 deletions tests/overload_bool
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ sub render {
my $foo = 1;
my $boolobj = bless {}, 'Foo' if $foo;

if ($] >= 5.010) {
eval '$boolobj //= 5;';
die if $@;
}
$boolobj //= 5;

1;

0 comments on commit 7ae5300

Please sign in to comment.