From 7ae53009ff77d88e1df48b385e448cbc4a99ff69 Mon Sep 17 00:00:00 2001 From: Ed J Date: Wed, 20 Nov 2024 13:03:02 +0000 Subject: [PATCH] update overload_bool to drop pre-5.12 support --- test_output/cover/overload_bool.5.012000 | 25 ++++++++++++++---------- tests/overload_bool | 5 +---- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/test_output/cover/overload_bool.5.012000 b/test_output/cover/overload_bool.5.012000 index 8b0d64d2..770f085d 100644 --- a/test_output/cover/overload_bool.5.012000 +++ b/test_output/cover/overload_bool.5.012000 @@ -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 ------------------- ------ ------ ------ ------ ------ @@ -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 @@ -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 diff --git a/tests/overload_bool b/tests/overload_bool index 26ca965e..f2eb4c0e 100644 --- a/tests/overload_bool +++ b/tests/overload_bool @@ -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;