[exim-cvs] Testsuite: retire perl smartmatch use

Página superior
Eliminar este mensaje
Responder a este mensaje
Autor: Exim Git Commits Mailing List
Fecha:  
A: exim-cvs
Asunto: [exim-cvs] Testsuite: retire perl smartmatch use
Gitweb: https://git.exim.org/exim.git/commitdiff/7b3b8d1195f89869199d78db2d8b357a6f0ca473
Commit:     7b3b8d1195f89869199d78db2d8b357a6f0ca473
Parent:     8ab9474f03559cc0700b85bc8c4c3581275e9f8e
Author:     Bernard Quatermass <bernardq@???>
AuthorDate: Thu Oct 5 21:35:12 2023 +0100
Committer:  Jeremy Harris <jgh146exb@???>
CommitDate: Thu Oct 5 21:46:11 2023 +0100


    Testsuite: retire perl smartmatch use


    Recent perl versions whine that smartmatch is deprecated
---
 test/runtest | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)


diff --git a/test/runtest b/test/runtest
index ef202985a..24f80d3a4 100755
--- a/test/runtest
+++ b/test/runtest
@@ -18,7 +18,6 @@
#use strict;
use v5.10.1;
use warnings;
-use if $^V >= v5.19.11, experimental => 'smartmatch';

use Errno;
use FileHandle;
@@ -3400,6 +3399,7 @@ GetOptions(
print "Exim binary is `$parm_exim'\n" if defined $parm_exim;


+my %wanted;
 my @wanted = sort numerically uniq
   @tests_wanted ? @tests_wanted : (),
   @range_wanted ? $range_wanted[0] .. $range_wanted[1] : (),
@@ -3408,6 +3408,7 @@ my @wanted = sort numerically uniq
           0+$ARGV[0]..0+$ARGV[1]    # add 0 to cope with test numbers starting with zero
         : ();
 @wanted = 1..TEST_TOP if not @wanted;
+map { $wanted{sprintf("%04d",$_)}= $_; } @wanted;


 ##################################################
 #        Check for sudo access to root           #
@@ -4220,7 +4221,8 @@ DIR: for (my $i = 0; $i < @test_dirs; $i++)
   # We want the tests from this subdirectory, provided they are in the
   # range that was selected.


- @testlist = grep { $_ ~~ @wanted } grep { /^\d+(?:\.\d+)?$/ } map { basename $_ } glob "scripts/$testdir/*";
+ undef @testlist;
+ map { push @testlist, $_ if exists $wanted{$_} } grep { /^\d+(?:\.\d+)?$/ } map { basename $_ } glob "scripts/$testdir/*";

   tests_exit(-1, "Failed to read test scripts from `scripts/$testdir/*': $!")
     if not @testlist;


--
## subscription configuration (requires account):
## https://lists.exim.org/mailman3/postorius/lists/exim-cvs.lists.exim.org/
## unsubscribe (doesn't require an account):
## exim-cvs-unsubscribe@???
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/