This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Refactor t/lib/proxy_constant_subs.t to use skip_all_without_extension()
authorNicholas Clark <nick@ccl4.org>
Mon, 7 Mar 2011 17:10:26 +0000 (17:10 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 7 Mar 2011 17:10:26 +0000 (17:10 +0000)
t/lib/proxy_constant_subs.t

index 7c00830..c6de618 100644 (file)
@@ -1,18 +1,11 @@
 my @symbols;
 BEGIN {
-    require Config;
-    if (($Config::Config{'extensions'} !~ /\bB\b/) ){
-        print "1..0 # Skip -- Perl configured without B module\n";
-        exit 0;
-    }
-    if ($Config::Config{'extensions'} !~ /\bFcntl\b/) {
-        print "1..0 # Skip -- Perl configured without Fcntl\n";
-        exit 0;
-    }
+    require './test.pl';
+    skip_all_without_extension('B');
+    skip_all_without_extension('Fcntl');
     # S_IFMT is a real subroutine, and acts as control
     # SEEK_SET is a proxy constant subroutine.
     @symbols = qw(S_IFMT SEEK_SET);
-    require './test.pl';
 }
 
 use strict;