From 1e38102716eda4e4fbf411e8cdd4d3154522eb86 Mon Sep 17 00:00:00 2001 From: Lukas Mai Date: Sat, 15 Mar 2025 10:52:45 +0100 Subject: [PATCH] various tests: replace BEGIN/require/import by use That is, turn BEGIN { require Foo; Foo->import(...); } into use Foo ...; (Except for a few tests that did the `require Config; Config->import` dance without actually using `%Config` anywhere, so I just deleted the import code.) --- dist/I18N-Collate/t/I18N-Collate.t | 2 +- dist/IO/t/io_linenum.t | 2 +- dist/Safe/t/safe1.t | 2 +- dist/Safe/t/safe2.t | 2 +- dist/Safe/t/safe3.t | 2 +- dist/Safe/t/safeload.t | 3 +-- dist/Safe/t/saferegexp.t | 2 +- dist/Safe/t/safesecurity.t | 3 +-- dist/Safe/t/safesig.t | 3 +-- dist/Safe/t/safesort.t | 2 +- dist/Safe/t/safeuniversal.t | 3 +-- dist/Safe/t/safeutf8.t | 2 +- dist/Safe/t/safewrap.t | 2 +- ext/Devel-Peek/t/Peek.t | 2 +- ext/Fcntl/t/syslfs.t | 4 ++-- ext/IPC-Open3/t/IPC-Open3.t | 2 +- ext/Opcode/t/Opcode.t | 2 +- ext/Opcode/t/ops.t | 2 +- ext/POSIX/t/mb.t | 2 +- ext/POSIX/t/posix.t | 2 +- ext/POSIX/t/taint.t | 2 +- ext/Sys-Hostname/t/Hostname.t | 2 +- ext/XS-APItest/t/my_cxt.t | 2 +- ext/XS-Typemap/t/Typemap.t | 2 +- lib/AnyDBM_File.t | 6 +++--- lib/Net/hostent.t | 4 +--- lib/locale.t | 2 +- lib/open.t | 2 +- t/io/errnosig.t | 2 +- t/io/pipe.t | 2 +- t/io/semctl.t | 2 +- t/lib/commonsense.t | 3 +-- t/op/lc.t | 1 - t/op/quotemeta.t | 2 +- t/re/anyof.t | 2 +- t/re/fold_grind.pl | 1 - t/re/pat.t | 2 +- t/re/speed.t | 2 +- t/re/stclass_threads.t | 1 - t/re/subst.t | 5 ++--- t/run/runenv_hashseed.t | 3 +-- t/run/runenv_randseed.t | 3 +-- t/run/switchM.t | 4 +--- t/run/switches.t | 5 ++--- t/run/todo.t | 2 +- t/uni/fold.t | 1 - t/uni/overload.t | 1 - t/win32/runenv.t | 4 ++-- 48 files changed, 49 insertions(+), 67 deletions(-) diff --git a/dist/I18N-Collate/t/I18N-Collate.t b/dist/I18N-Collate/t/I18N-Collate.t index 5916f5e4bd7e..b73b0e9ded93 100644 --- a/dist/I18N-Collate/t/I18N-Collate.t +++ b/dist/I18N-Collate/t/I18N-Collate.t @@ -6,8 +6,8 @@ use strict; no warnings; +use Config; BEGIN { - require Config; Config->import; if (!$::Config{d_setlocale} || $::Config{ccflags} =~ /\bD?NO_LOCALE\b/) { print "1..0\n"; exit; diff --git a/dist/IO/t/io_linenum.t b/dist/IO/t/io_linenum.t index d315c37e0e26..bad25c2214d2 100644 --- a/dist/IO/t/io_linenum.t +++ b/dist/IO/t/io_linenum.t @@ -7,8 +7,8 @@ my $File; BEGIN { $File = __FILE__; - require strict; strict->import(); } +use strict; use Test::More tests => 12; diff --git a/dist/Safe/t/safe1.t b/dist/Safe/t/safe1.t index e9bd5cf675fd..15602e65dcb4 100644 --- a/dist/Safe/t/safe1.t +++ b/dist/Safe/t/safe1.t @@ -1,7 +1,7 @@ #!./perl -w $|=1; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safe2.t b/dist/Safe/t/safe2.t index 216808484631..62cc163d2ac8 100644 --- a/dist/Safe/t/safe2.t +++ b/dist/Safe/t/safe2.t @@ -1,7 +1,7 @@ #!./perl -w $|=1; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safe3.t b/dist/Safe/t/safe3.t index fcca684ea919..b0094db9d921 100644 --- a/dist/Safe/t/safe3.t +++ b/dist/Safe/t/safe3.t @@ -1,7 +1,7 @@ #!perl -w +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'extensions'} !~ /\bPOSIX\b/ && $Config{'osname'} ne 'VMS') diff --git a/dist/Safe/t/safeload.t b/dist/Safe/t/safeload.t index f8cb75513ed0..fcdaa52dd4ff 100644 --- a/dist/Safe/t/safeload.t +++ b/dist/Safe/t/safeload.t @@ -1,8 +1,7 @@ #!perl +use Config; BEGIN { - require Config; - Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/) { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/saferegexp.t b/dist/Safe/t/saferegexp.t index 674495c71ed3..3ca6a9888962 100644 --- a/dist/Safe/t/saferegexp.t +++ b/dist/Safe/t/saferegexp.t @@ -1,7 +1,7 @@ #!perl -w +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/) { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safesecurity.t b/dist/Safe/t/safesecurity.t index 17362a286205..0e0cdb82792e 100644 --- a/dist/Safe/t/safesecurity.t +++ b/dist/Safe/t/safesecurity.t @@ -1,8 +1,7 @@ #!perl +use Config; BEGIN { - require Config; - Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/) { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safesig.t b/dist/Safe/t/safesig.t index 62c67ed64140..a74648096177 100644 --- a/dist/Safe/t/safesig.t +++ b/dist/Safe/t/safesig.t @@ -1,8 +1,7 @@ #!perl +use Config; BEGIN { - require Config; - Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/) { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safesort.t b/dist/Safe/t/safesort.t index 827ec5372f1f..78acb03d3840 100644 --- a/dist/Safe/t/safesort.t +++ b/dist/Safe/t/safesort.t @@ -1,7 +1,7 @@ #!perl -w $|=1; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safeuniversal.t b/dist/Safe/t/safeuniversal.t index 587addb6bd82..86de73b32e9a 100644 --- a/dist/Safe/t/safeuniversal.t +++ b/dist/Safe/t/safeuniversal.t @@ -1,8 +1,7 @@ #!perl +use Config; BEGIN { - require Config; - Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/) { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safeutf8.t b/dist/Safe/t/safeutf8.t index eec57a4a0f89..cc34c27f956a 100644 --- a/dist/Safe/t/safeutf8.t +++ b/dist/Safe/t/safeutf8.t @@ -1,7 +1,7 @@ #!perl -w $|=1; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/dist/Safe/t/safewrap.t b/dist/Safe/t/safewrap.t index c9d8b96828ad..98070ff3ebeb 100644 --- a/dist/Safe/t/safewrap.t +++ b/dist/Safe/t/safewrap.t @@ -1,8 +1,8 @@ #!perl -w $|=1; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/ext/Devel-Peek/t/Peek.t b/ext/Devel-Peek/t/Peek.t index 77128c4d17eb..5df93c02e494 100644 --- a/ext/Devel-Peek/t/Peek.t +++ b/ext/Devel-Peek/t/Peek.t @@ -1,7 +1,7 @@ #!./perl -T +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bDevel\/Peek\b/) { print "1..0 # Skip: Devel::Peek was not built\n"; exit 0; diff --git a/ext/Fcntl/t/syslfs.t b/ext/Fcntl/t/syslfs.t index bd9c7b21d30f..e94b2dd4ae2c 100644 --- a/ext/Fcntl/t/syslfs.t +++ b/ext/Fcntl/t/syslfs.t @@ -2,15 +2,15 @@ # stdio: open(), tell(), seek(), print(), read() is tested in t/op/lfs.t. # If you modify/add tests here, remember to update also t/op/lfs.t. +use Config; BEGIN { - require Config; Config->import; # Don't bother if there are no quad offsets. if ($Config{lseeksize} < 8) { print "1..0 # Skip: no 64-bit file offsets\n"; exit(0); } - require Fcntl; Fcntl->import(qw(/^O_/ /^SEEK_/)); } +use Fcntl qw(/^O_/ /^SEEK_/); use strict; use File::Temp 'tempfile'; diff --git a/ext/IPC-Open3/t/IPC-Open3.t b/ext/IPC-Open3/t/IPC-Open3.t index a30f361e7207..616e9e2f3a97 100644 --- a/ext/IPC-Open3/t/IPC-Open3.t +++ b/ext/IPC-Open3/t/IPC-Open3.t @@ -1,7 +1,7 @@ #!./perl -w +use Config; BEGIN { - require Config; Config->import; if (!$Config{'d_fork'} # open2/3 supported on win32 && $^O ne 'MSWin32') diff --git a/ext/Opcode/t/Opcode.t b/ext/Opcode/t/Opcode.t index 1f43d8942d47..5900d20ece3c 100644 --- a/ext/Opcode/t/Opcode.t +++ b/ext/Opcode/t/Opcode.t @@ -2,8 +2,8 @@ $|=1; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/ext/Opcode/t/ops.t b/ext/Opcode/t/ops.t index 07564145943c..539cdc144909 100644 --- a/ext/Opcode/t/ops.t +++ b/ext/Opcode/t/ops.t @@ -1,7 +1,7 @@ #!./perl +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bOpcode\b/ && $Config{'osname'} ne 'VMS') { print "1..0\n"; exit 0; diff --git a/ext/POSIX/t/mb.t b/ext/POSIX/t/mb.t index 2af5f855d4f8..260c32644d56 100644 --- a/ext/POSIX/t/mb.t +++ b/ext/POSIX/t/mb.t @@ -7,8 +7,8 @@ # the Perl one. So we run the tests in a separate "fresh_perl" process # with the correct LC_CTYPE set in the environment. +use Config; BEGIN { - require Config; Config->import; if ($^O ne 'VMS' and $Config{'extensions'} !~ /\bPOSIX\b/) { print "1..0\n"; exit 0; diff --git a/ext/POSIX/t/posix.t b/ext/POSIX/t/posix.t index 059c63a28424..999197aa916b 100644 --- a/ext/POSIX/t/posix.t +++ b/ext/POSIX/t/posix.t @@ -1,7 +1,7 @@ #!./perl +use Config; BEGIN { - require Config; Config->import; if ($^O ne 'VMS' and $Config{'extensions'} !~ /\bPOSIX\b/) { print "1..0\n"; exit 0; diff --git a/ext/POSIX/t/taint.t b/ext/POSIX/t/taint.t index 00ca4ec16a42..4facd0fdf4ee 100644 --- a/ext/POSIX/t/taint.t +++ b/ext/POSIX/t/taint.t @@ -1,7 +1,7 @@ #!./perl -Tw +use Config; BEGIN { - require Config; Config->import; if ($^O ne 'VMS' and $Config{'extensions'} !~ /\bPOSIX\b/) { print "1..0\n"; exit 0; diff --git a/ext/Sys-Hostname/t/Hostname.t b/ext/Sys-Hostname/t/Hostname.t index c40d1e161db8..4ee672a08107 100644 --- a/ext/Sys-Hostname/t/Hostname.t +++ b/ext/Sys-Hostname/t/Hostname.t @@ -1,7 +1,7 @@ #!./perl +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bSys\/Hostname\b/) { print "1..0 # Skip: Sys::Hostname was not built\n"; exit 0; diff --git a/ext/XS-APItest/t/my_cxt.t b/ext/XS-APItest/t/my_cxt.t index be03309e21bb..eb5f6335a43d 100644 --- a/ext/XS-APItest/t/my_cxt.t +++ b/ext/XS-APItest/t/my_cxt.t @@ -4,8 +4,8 @@ # DAPM Dec 2005 my $threads; +use Config; BEGIN { - require Config; Config->import; $threads = $Config{'useithreads'}; # must 'use threads' before 'use Test::More' eval 'use threads' if $threads; diff --git a/ext/XS-Typemap/t/Typemap.t b/ext/XS-Typemap/t/Typemap.t index 7badbd8de3d5..e10355edbeb0 100644 --- a/ext/XS-Typemap/t/Typemap.t +++ b/ext/XS-Typemap/t/Typemap.t @@ -1,5 +1,5 @@ +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bXS\/Typemap\b/) { print "1..0 # Skip: XS::Typemap was not built\n"; exit 0; diff --git a/lib/AnyDBM_File.t b/lib/AnyDBM_File.t index 045fa45616c5..8d063ba320a7 100644 --- a/lib/AnyDBM_File.t +++ b/lib/AnyDBM_File.t @@ -3,10 +3,10 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - require Config; Config->import; - require Test::More; Test::More->import; - plan(tests, 12); } +use Config; +use Test::More; +plan(tests, 12); require AnyDBM_File; use Fcntl; diff --git a/lib/Net/hostent.t b/lib/Net/hostent.t index dbe4a6b7e03a..5a8bf31a2f50 100644 --- a/lib/Net/hostent.t +++ b/lib/Net/hostent.t @@ -6,9 +6,9 @@ BEGIN { } use Test::More; +use Config; BEGIN { - require Config; Config->import; if ($Config{'extensions'} !~ /\bSocket\b/ && !(($^O eq 'VMS') && $Config{d_socket})) { @@ -19,8 +19,6 @@ BEGIN { } } -use Test::More; - BEGIN { use_ok 'Net::hostent' } # Remind me to add this to Test::More. diff --git a/lib/locale.t b/lib/locale.t index 5a97de9ae6f2..f441d389ccdd 100644 --- a/lib/locale.t +++ b/lib/locale.t @@ -54,8 +54,8 @@ BEGIN { exit; } $| = 1; - require Config; Config->import; } +use Config; use feature 'fc'; my @langinfo; diff --git a/lib/open.t b/lib/open.t index 00a8a1449590..6218c57efe7e 100644 --- a/lib/open.t +++ b/lib/open.t @@ -3,10 +3,10 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - require Config; Config->import; require './test.pl'; require './charset_tools.pl'; } +use Config; plan 11; diff --git a/t/io/errnosig.t b/t/io/errnosig.t index 174e65684fab..2e0b70378c39 100644 --- a/t/io/errnosig.t +++ b/t/io/errnosig.t @@ -6,7 +6,7 @@ BEGIN { set_up_inc( qw(. ../lib) ); } -require Config; Config->import; +use Config; plan(tests => 1); SKIP: { diff --git a/t/io/pipe.t b/t/io/pipe.t index 91f4fba0c0a9..980de94a93b2 100644 --- a/t/io/pipe.t +++ b/t/io/pipe.t @@ -4,8 +4,8 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib'); - require Config; Config->import; } +use Config; if (!$Config{'d_fork'}) { skip_all("fork required to pipe"); } diff --git a/t/io/semctl.t b/t/io/semctl.t index 0b36f2c34b5a..2fdf4dfdda13 100644 --- a/t/io/semctl.t +++ b/t/io/semctl.t @@ -3,8 +3,8 @@ BEGIN { @INC = '../lib' if -d '../lib' && -d '../ext'; require "./test.pl"; - require Config; Config->import; } +use Config; use strict; use warnings; diff --git a/t/lib/commonsense.t b/t/lib/commonsense.t index 7705fee24ef3..83d7f622a394 100644 --- a/t/lib/commonsense.t +++ b/t/lib/commonsense.t @@ -5,11 +5,10 @@ BEGIN { @INC = '../lib'; require './test.pl'; } +use Config; plan( tests => 1); -require Config; Config->import; - if (($Config{'extensions'} !~ /\bFcntl\b/) ){ BAIL_OUT("Perl configured without Fcntl module"); } diff --git a/t/op/lc.t b/t/op/lc.t index b0ecfb6c583f..4cb2553bbbc6 100644 --- a/t/op/lc.t +++ b/t/op/lc.t @@ -9,7 +9,6 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib'); - require Config; Config->import; skip_all_without_unicode_tables(); require './charset_tools.pl'; require './loc_tools.pl'; # Contains find_utf8_ctype_locale() diff --git a/t/op/quotemeta.t b/t/op/quotemeta.t index 201c49929134..9328e8e7d36a 100644 --- a/t/op/quotemeta.t +++ b/t/op/quotemeta.t @@ -4,9 +4,9 @@ BEGIN { chdir 't' if -d 't'; require "./test.pl"; set_up_inc( qw(../lib .) ); - require Config; Config->import; require "./loc_tools.pl"; } +use Config; plan tests => 60; diff --git a/t/re/anyof.t b/t/re/anyof.t index de891154350d..1f42e1353ced 100644 --- a/t/re/anyof.t +++ b/t/re/anyof.t @@ -16,9 +16,9 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib','.','../ext/re'); - require Config; Config->import; skip_all('no re module') unless defined &DynaLoader::boot_DynaLoader; } +use Config; # An array is used instead of a hash, so that the tests are carried out in the # order given by this file. Even-numbered indices are the regexes to compile. diff --git a/t/re/fold_grind.pl b/t/re/fold_grind.pl index 306b4d9cb7e1..2922b25dc57c 100644 --- a/t/re/fold_grind.pl +++ b/t/re/fold_grind.pl @@ -12,7 +12,6 @@ BEGIN chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib'); - require Config; Config->import; skip_all_if_miniperl("no dynamic loading on miniperl, no Encode nor POSIX"); if ($^O eq 'dec_osf') { skip_all("$^O cannot handle this test"); diff --git a/t/re/pat.t b/t/re/pat.t index 39ce47538c83..2a707e7f0a8a 100644 --- a/t/re/pat.t +++ b/t/re/pat.t @@ -18,10 +18,10 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib', '.', '../ext/re'); - require Config; Config->import; require './charset_tools.pl'; require './loc_tools.pl'; } +use Config; skip_all_without_unicode_tables(); diff --git a/t/re/speed.t b/t/re/speed.t index 637a549c2ade..b61009c3b45f 100644 --- a/t/re/speed.t +++ b/t/re/speed.t @@ -18,8 +18,8 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib','.','../ext/re'); - require Config; Config->import; } +use Config; skip_all('no re module') unless defined &DynaLoader::boot_DynaLoader; skip_all_without_unicode_tables(); diff --git a/t/re/stclass_threads.t b/t/re/stclass_threads.t index afe46b6ddb7b..b593758cb164 100644 --- a/t/re/stclass_threads.t +++ b/t/re/stclass_threads.t @@ -15,7 +15,6 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib', '.', '../ext/re'); - require Config; Config->import; } skip_all_without_config('useithreads'); diff --git a/t/re/subst.t b/t/re/subst.t index 8cf3e02e7323..6035b260e795 100644 --- a/t/re/subst.t +++ b/t/re/subst.t @@ -4,12 +4,11 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc('../lib'); - require Config; Config->import; - require constant; - constant->import(constcow => *Config::{NAME}); require './charset_tools.pl'; require './loc_tools.pl'; } +use Config; +use constant constcow => *Config::{NAME}; plan(tests => 281); diff --git a/t/run/runenv_hashseed.t b/t/run/runenv_hashseed.t index 75d4af847ab9..67bb49162c49 100644 --- a/t/run/runenv_hashseed.t +++ b/t/run/runenv_hashseed.t @@ -45,9 +45,8 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; - require Config; - Config->import; } +use Config; skip_all_without_config('d_fork'); skip_all("NO_PERL_HASH_ENV or NO_PERL_HASH_SEED_DEBUG set") diff --git a/t/run/runenv_randseed.t b/t/run/runenv_randseed.t index bdcf20269c5f..49698e7b9af1 100644 --- a/t/run/runenv_randseed.t +++ b/t/run/runenv_randseed.t @@ -4,9 +4,8 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require './test.pl'; - require Config; - Config->import; } +use Config; skip_all_without_config('d_fork'); skip_all("This perl is built with NO_PERL_RAND_SEED") diff --git a/t/run/switchM.t b/t/run/switchM.t index 5944669883ce..55dbf2b3a8d0 100644 --- a/t/run/switchM.t +++ b/t/run/switchM.t @@ -3,10 +3,8 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - require Config; - Config->import; - } +use Config; use strict; use warnings; diff --git a/t/run/switches.t b/t/run/switches.t index 210089bb0f22..bf440e1a132b 100644 --- a/t/run/switches.t +++ b/t/run/switches.t @@ -7,11 +7,10 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - require Config; Config->import; + require "./test.pl"; + require "./loc_tools.pl"; } -BEGIN { require "./test.pl"; require "./loc_tools.pl"; } - use Config; # due to a bug in VMS's piping which makes it impossible for runperl() diff --git a/t/run/todo.t b/t/run/todo.t index fc963e9ac5f8..939916d06193 100644 --- a/t/run/todo.t +++ b/t/run/todo.t @@ -5,8 +5,8 @@ BEGIN { set_up_inc('../lib', '.', '../ext/re'); require './charset_tools.pl'; require './loc_tools.pl'; - require Config; Config->import; } +use Config; use strict; use warnings; diff --git a/t/uni/fold.t b/t/uni/fold.t index f919c78ef72e..e03b5f4a0a68 100644 --- a/t/uni/fold.t +++ b/t/uni/fold.t @@ -10,7 +10,6 @@ BEGIN { set_up_inc('../lib'); skip_all_without_unicode_tables(); skip_all_if_miniperl("miniperl, no Unicode::Normalize"); - require Config; Config->import; require './charset_tools.pl'; require './loc_tools.pl'; # Contains find_utf8_ctype_locale() } diff --git a/t/uni/overload.t b/t/uni/overload.t index f126fa362767..6fc153d571f3 100644 --- a/t/uni/overload.t +++ b/t/uni/overload.t @@ -4,7 +4,6 @@ BEGIN { chdir 't' if -d 't'; require './test.pl'; set_up_inc( '../lib' ); - require Config; Config->import; require './charset_tools.pl'; require './loc_tools.pl'; } diff --git a/t/win32/runenv.t b/t/win32/runenv.t index d9384057d7db..04bede1b92ce 100644 --- a/t/win32/runenv.t +++ b/t/win32/runenv.t @@ -8,8 +8,6 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; - require Config; Config->import; - require File::Temp; File::Temp->import(qw/:POSIX/); require Win32; ($::os_id, $::os_major) = ( Win32::GetOSVersion() )[ 4, 1 ]; @@ -22,6 +20,8 @@ BEGIN { require './test.pl'; } +use Config; +use File::Temp qw/:POSIX/; skip_all "requires compilation with PERL_IMPLICIT_SYS" unless $Config{ccflags} =~/(?:\A|\s)-DPERL_IMPLICIT_SYS\b/;