From: Andy Dougherty Date: Thu, 24 Jun 2004 15:09:47 +0000 (-0400) Subject: Correct detection of absent modules. Based on X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=98641f606c65e71cca89f9a694e2796b5a21cbd8;p=p5sagit%2Fp5-mst-13.2.git Correct detection of absent modules. Based on Subject: [PATCH] Config{extensions} uses filesystem names as extensions Message-ID: with improvements from Marcus Holland-Moritz p4raw-id: //depot/perl@22998 --- diff --git a/ext/Devel/PPPort/t/test.t b/ext/Devel/PPPort/t/test.t index 469bd87..aff8630 100644 --- a/ext/Devel/PPPort/t/test.t +++ b/ext/Devel/PPPort/t/test.t @@ -2,7 +2,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib' if -d '../lib'; require Config; - if (($Config::Config{'extensions'} !~ /\bDevel::PPPort\b/) ){ + if (($Config::Config{'extensions'} !~ m!\bDevel/PPPort\b!) ){ print "1..0 # Skip -- Perl configured without Devel::PPPort module\n"; exit 0; } diff --git a/ext/PerlIO/t/scalar.t b/ext/PerlIO/t/scalar.t index a4c4799..4021d43 100644 --- a/ext/PerlIO/t/scalar.t +++ b/ext/PerlIO/t/scalar.t @@ -8,7 +8,7 @@ BEGIN { exit 0; } require Config; - if (($Config::Config{'extensions'} !~ /\bPerlIO::scalar\b/) ){ + if (($Config::Config{'extensions'} !~ m!\bPerlIO/scalar\b!) ){ print "1..0 # Skip -- Perl configured without PerlIO::scalar module\n"; exit 0; } diff --git a/ext/PerlIO/t/via.t b/ext/PerlIO/t/via.t index 0d819df..7d46f40 100644 --- a/ext/PerlIO/t/via.t +++ b/ext/PerlIO/t/via.t @@ -8,7 +8,7 @@ BEGIN { exit 0; } require Config; - if (($Config::Config{'extensions'} !~ /\bPerlIO::via\b/) ){ + if (($Config::Config{'extensions'} !~ m!\bPerlIO/via\b!) ){ print "1..0 # Skip -- Perl configured without PerlIO::via module\n"; exit 0; } diff --git a/ext/threads/shared/t/disabled.t b/ext/threads/shared/t/disabled.t index 1add2b8..f3e90a7 100644 --- a/ext/threads/shared/t/disabled.t +++ b/ext/threads/shared/t/disabled.t @@ -6,7 +6,7 @@ BEGIN { chdir 't'; @INC = '../lib'; require Config; - if (($Config::Config{'extensions'} !~ /\bthreads::shared\b/) ){ + if (($Config::Config{'extensions'} !~ m!\bthreads/shared\b!) ){ print "1..0 # Skip -- Perl configured without threads::shared module\n"; exit 0; } diff --git a/lib/DB.t b/lib/DB.t index 7e809be..f665291 100644 --- a/lib/DB.t +++ b/lib/DB.t @@ -4,7 +4,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require Config; - if (($Config::Config{'extensions'} !~ /\bList::Util\b/) ){ + if (($Config::Config{'extensions'} !~ m!\bList/Util\b!) ){ print "1..0 # Skip -- Perl configured without List::Util module\n"; exit 0; } diff --git a/lib/Dumpvalue.t b/lib/Dumpvalue.t index 0158304..b22b86d 100644 --- a/lib/Dumpvalue.t +++ b/lib/Dumpvalue.t @@ -8,7 +8,7 @@ BEGIN { exit 0; } require Config; - if (($Config::Config{'extensions'} !~ /\bList::Util\b/) ){ + if (($Config::Config{'extensions'} !~ m!\bList/Util\b!) ){ print "1..0 # Skip -- Perl configured without List::Util module\n"; exit 0; } diff --git a/lib/PerlIO/via/t/QuotedPrint.t b/lib/PerlIO/via/t/QuotedPrint.t index 4774af3..baf0d1f 100644 --- a/lib/PerlIO/via/t/QuotedPrint.t +++ b/lib/PerlIO/via/t/QuotedPrint.t @@ -8,7 +8,7 @@ BEGIN { # Magic Perl CORE pragma exit 0; } require Config; - if (($Config::Config{'extensions'} !~ /\bPerlIO::via\b/) ){ + if (($Config::Config{'extensions'} !~ m!\bPerlIO/via\b!) ){ print "1..0 # Skip -- Perl configured without PerlIO::via module\n"; exit 0; } diff --git a/lib/Tie/RefHash.t b/lib/Tie/RefHash.t index a855446..c0fad91 100644 --- a/lib/Tie/RefHash.t +++ b/lib/Tie/RefHash.t @@ -14,7 +14,7 @@ BEGIN { @INC = '.'; push @INC, '../lib'; require Config; - if (($Config::Config{'extensions'} !~ /\bData::Dumper\b/) ){ + if (($Config::Config{'extensions'} !~ m!\bData/Dumper\b!) ){ print "1..0 # Skip -- Perl configured without Data::Dumper module\n"; exit 0; } diff --git a/lib/autouse.t b/lib/autouse.t index cc7c41a..2c52f42 100644 --- a/lib/autouse.t +++ b/lib/autouse.t @@ -4,7 +4,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require Config; - if (($Config::Config{'extensions'} !~ /\bList::Util\b/) ){ + if (($Config::Config{'extensions'} !~ m!\bList/Util\b!) ){ print "1..0 # Skip -- Perl configured without List::Util module\n"; exit 0; } diff --git a/lib/dumpvar.t b/lib/dumpvar.t index eb0fe31..843ba1c 100644 --- a/lib/dumpvar.t +++ b/lib/dumpvar.t @@ -4,7 +4,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require Config; - if (($Config::Config{'extensions'} !~ /\bList::Util\b/) ){ + if (($Config::Config{'extensions'} !~ m!\bList/Util\b!) ){ print "1..0 # Skip -- Perl configured without List::Util module\n"; exit 0; } diff --git a/lib/h2xs.t b/lib/h2xs.t index 5485323..e6c75c0 100644 --- a/lib/h2xs.t +++ b/lib/h2xs.t @@ -14,7 +14,7 @@ BEGIN { @INC = '../lib'; # FIXME (or rather FIXh2xs) require Config; - if (($Config::Config{'extensions'} !~ /\bDevel::PPPort\b/) ){ + if (($Config::Config{'extensions'} !~ m!\bDevel/PPPort\b!) ){ print "1..0 # Skip -- Perl configured without Devel::PPPort module\n"; exit 0; } diff --git a/lib/overload.t b/lib/overload.t index e21e60b..4184e23 100644 --- a/lib/overload.t +++ b/lib/overload.t @@ -4,7 +4,7 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; require Config; - if (($Config::Config{'extensions'} !~ /\bList::Util\b/) ){ + if (($Config::Config{'extensions'} !~ m!\bList/Util\b!) ){ print "1..0 # Skip -- Perl configured without List::Util module\n"; exit 0; } diff --git a/t/io/crlf.t b/t/io/crlf.t index f59b245..be51400 100644 --- a/t/io/crlf.t +++ b/t/io/crlf.t @@ -34,7 +34,7 @@ if (find PerlIO::Layer 'perlio') { { skip("miniperl can't rely on loading PerlIO::scalar") if $ENV{PERL_CORE_MINITEST}; - skip("no PerlIO::scalar") unless $Config{extensions} =~ /PerlIO::scalar/; + skip("no PerlIO::scalar") unless $Config{extensions} =~ m!\bPerlIO/scalar\b!; require PerlIO::scalar; my $fcontents = join "", map {"$_\015\012"} "a".."zzz"; open my $fh, "<:crlf", \$fcontents;