This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Refactor 4 tests to use skip_if_miniperl().
authorNicholas Clark <nick@ccl4.org>
Mon, 7 Mar 2011 21:55:36 +0000 (21:55 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 7 Mar 2011 21:55:36 +0000 (21:55 +0000)
t/io/open.t
t/op/magic.t
t/op/smartmatch.t
t/op/write.t

index 347bdc0..57412eb 100644 (file)
@@ -228,8 +228,7 @@ like( $@, qr/Bad filehandle:\s+$afile/,          '       right error' );
 
 SKIP: {
     skip "This perl uses perlio", 1 if $Config{useperlio};
-    skip "miniperl cannot be relied on to load %Errno"
-       if $ENV{PERL_CORE_MINITEST};
+    skip_if_miniperl("miniperl can't rely on loading %Errno", 1);
     # Force the reference to %! to be run time by writing ! as {"!"}
     skip "This system doesn't understand EINVAL", 1
        unless exists ${"!"}{EINVAL};
index 403cba7..a8247c0 100644 (file)
@@ -21,7 +21,6 @@ $Is_Dos      = $^O eq 'dos';
 $Is_os2      = $^O eq 'os2';
 $Is_Cygwin   = $^O eq 'cygwin';
 $Is_MPE      = $^O eq 'mpeix';         
-$Is_miniperl = $ENV{PERL_CORE_MINITEST};
 $Is_BeOS     = $^O eq 'beos';
 
 $PERL = $ENV{PERL}
@@ -335,7 +334,7 @@ EOP
 }
 
 SKIP: {
-    skip ("miniperl can't rely on loading %Errno", 2) if $Is_miniperl;
+    skip_if_miniperl("miniperl can't rely on loading %Errno", 2);
    no warnings 'void';
 
 # Make sure Errno hasn't been prematurely autoloaded
@@ -351,7 +350,7 @@ SKIP: {
 }
 
 SKIP:  {
-    skip ("miniperl can't rely on loading %Errno") if $Is_miniperl;
+    skip_if_miniperl("miniperl can't rely on loading %Errno", 1);
     # Make sure that Errno loading doesn't clobber $!
 
     undef %Errno::;
index f14e91c..da4840e 100644 (file)
@@ -11,7 +11,6 @@ no warnings 'uninitialized';
 
 use Tie::Array;
 use Tie::Hash;
-use if !$ENV{PERL_CORE_MINITEST}, "Tie::RefHash";
 
 # Predeclare vars used in the tests:
 my @empty;
@@ -62,7 +61,8 @@ our $obj = Test::Object::NoOverload->new;
 our $str_obj = Test::Object::StringOverload->new;
 
 my %refh;
-if (!$ENV{PERL_CORE_MINITEST}) {
+unless (is_miniperl()) {
+    require Tie::RefHash;
     tie %refh, 'Tie::RefHash';
     $refh{$ov_obj} = 1;
 }
@@ -92,10 +92,9 @@ while (<DATA>) {
     if ($note =~ /NOWARNINGS/) {
        $res = eval "no warnings; $tstr";
     }
-    elsif ($note =~ /MINISKIP/ && $ENV{PERL_CORE_MINITEST}) {
-       skip("Doesn't work with miniperl", $yn =~ /=/ ? 2 : 1);
-    }
     else {
+       skip_if_miniperl("Doesn't work with miniperl", $yn =~ /=/ ? 2 : 1)
+           if $note =~ /MINISKIP/;
        $res = eval $tstr;
     }
 
index b5c2210..b19db71 100644 (file)
@@ -610,10 +610,8 @@ close STDOUT_DUP;
 *CmT =  *{$::{Comment}}{FORMAT};
 ok  defined *{$::{CmT}}{FORMAT}, "glob assign";
 
-if ($ENV{PERL_CORE_MINITEST}) {
-    ok 1, "Skip test for miniperl, as it does not support scalario";
-}
-else {
+SKIP: {
+    skip_if_miniperl('miniperl does not support scalario');
     my $buf = "";
     open my $fh, ">", \$buf;
     my $old_fh = select $fh;