From: Yves Orton Date: Sat, 4 Mar 2023 07:54:04 +0000 (+0100) Subject: t/ - Given is deprecated in 5.37.10, do not test it X-Git-Tag: rt146897~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=ef4ac48db70f6d8dcaa21e6b67e7fbec7a50cf7b;p=perl%2Fmodules%2FScope-Upper.git t/ - Given is deprecated in 5.37.10, do not test it This silences vast numbers of warnings, and will prevent the module from breaking in 5.42. --- diff --git a/t/05-words.t b/t/05-words.t index 9fe39ff..a5acb6b 100644 --- a/t/05-words.t +++ b/t/05-words.t @@ -339,8 +339,11 @@ $var =~ s{.}{do { my $x; UP }}e; is $var, 1, 'subst : do block preserved' unless $^P; SKIP: { - skip 'Perl 5.10 required to test given/when' => 4 * ($^P ? 4 : 5) + 4 - if "$]" < 5.010; + my $skip_count = 4 * ($^P ? 4 : 5) + 4; + skip 'Perl 5.10 required to test given/when' + => $skip_count if "$]" < 5.010; + skip 'Not testing deprecated given/when on Perl 5.37.10 or later' + => $skip_count if "$]" >= 5.037010; eval <<'TEST_GIVEN'; BEGIN { diff --git a/t/13-reap-ctl.t b/t/13-reap-ctl.t index 085cc05..d7a7f14 100644 --- a/t/13-reap-ctl.t +++ b/t/13-reap-ctl.t @@ -138,6 +138,8 @@ $y = undef; SKIP: { skip 'Perl 5.10 required to test given/when' => 30 if "$]" < 5.010; + skip 'Not testing deprecated given/when on Perl 5.37.10 or later' + => 30 if "$]" >= 5.037010; eval <<' GIVEN_TEST_1'; BEGIN { diff --git a/t/23-localize-ctl.t b/t/23-localize-ctl.t index b72be22..aaefdb6 100644 --- a/t/23-localize-ctl.t +++ b/t/23-localize-ctl.t @@ -191,6 +191,8 @@ $y = undef; SKIP: { skip 'Perl 5.10 required to test given/when' => 30 if "$]" < 5.010; + skip 'Not testing deprecated given/when on Perl 5.37.10 or later' + => 30 if "$]" >= 5.037010; eval <<' GIVEN_TEST_1'; BEGIN { diff --git a/t/55-yield-target.t b/t/55-yield-target.t index ced05c8..682d4cc 100644 --- a/t/55-yield-target.t +++ b/t/55-yield-target.t @@ -81,6 +81,8 @@ SKIP: { SKIP: { skip 'perl 5.10 is required to test interaction with given/when' => 6 if "$]" < 5.010; + skip 'Not testing deprecated given/when on Perl 5.37.10 or later' + => 6 if "$]" >= 5.037010; @res = eval <<'TESTCASE'; BEGIN { diff --git a/t/lib/Scope/Upper/TestGenerator.pm b/t/lib/Scope/Upper/TestGenerator.pm index b4f6e1b..df175ac 100644 --- a/t/lib/Scope/Upper/TestGenerator.pm +++ b/t/lib/Scope/Upper/TestGenerator.pm @@ -32,7 +32,7 @@ my @blocks = ( [ 'eval q[', '];' ], ); -push @blocks, [ 'given (1) {', '}' ] if "$]" >= 5.010_001; +push @blocks, [ 'given (1) {', '}' ] if "$]" >= 5.010_001 and "$]" < 5.037_010; my %exports = ( verbose_is => \&verbose_is,