Rename test.pl's skip_all_without_extension to *_dynamic_extension().
authorNicholas Clark <nick@ccl4.org>
Sat, 12 Mar 2011 17:44:59 +0000 (17:44 +0000)
committerNicholas Clark <nick@ccl4.org>
Sat, 12 Mar 2011 17:44:59 +0000 (17:44 +0000)
All callers were using it with dynamic extensions, and also had a
skip_all_if_miniperl() for the same extension. Merge the two tests into one
function to save repetition.

12 files changed:
t/io/layers.t
t/io/perlio_open.t
t/lib/proxy_constant_subs.t
t/test.pl
t/uni/chomp.t
t/uni/chr.t
t/uni/greek.t
t/uni/latin2.t
t/uni/tr_7jis.t
t/uni/tr_eucjp.t
t/uni/tr_sjis.t
t/uni/tr_utf8.t

index d0b55f1..55dc2fa 100644 (file)
@@ -8,8 +8,7 @@ BEGIN {
     require './test.pl';
     skip_all_without_perlio();
     # FIXME - more of these could be tested without Encode or full perl
-    skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
-    skip_all_without_extension('Encode');
+    skip_all_without_dynamic_extension('Encode');
 
     # Makes testing easier.
     $ENV{PERLIO} = 'stdio' if exists $ENV{PERLIO} && $ENV{PERLIO} eq '';
index 9969796..702c76c 100644 (file)
@@ -5,8 +5,7 @@ BEGIN {
     @INC = '../lib';
     require './test.pl';
     skip_all_without_perlio();
-    skip_all_if_miniperl("no dynamic loading on miniperl, no Fcntl");
-    skip_all_without_extension('Fcntl'); # how did you get this far?
+    skip_all_without_dynamic_extension('Fcntl'); # how did you get this far?
 }
 
 use strict;
index c6de618..e3cb41d 100644 (file)
@@ -1,8 +1,7 @@
 my @symbols;
 BEGIN {
     require './test.pl';
-    skip_all_without_extension('B');
-    skip_all_without_extension('Fcntl');
+    skip_all_without_dynamic_extension($_) foreach qw(B Fcntl);
     # S_IFMT is a real subroutine, and acts as control
     # SEEK_SET is a proxy constant subroutine.
     @symbols = qw(S_IFMT SEEK_SET);
index 34150aa..21bf1d2 100644 (file)
--- a/t/test.pl
+++ b/t/test.pl
@@ -122,8 +122,9 @@ sub skip_all_if_miniperl {
     skip_all(@_) if is_miniperl();
 }
 
-sub skip_all_without_extension {
+sub skip_all_without_dynamic_extension {
     my $extension = shift;
+    skip_all("no dynamic loading on miniperl, no $extension") if is_miniperl();
     unless (eval {require Config; 1}) {
        warn "test.pl had problems loading Config: $@";
        return;
index 1292fb6..0dca91a 100644 (file)
@@ -2,10 +2,9 @@
 
 BEGIN {
     require './test.pl';
-    skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+    skip_all_without_dynamic_extension('Encode');
     skip_all("EBCDIC") if $::IS_EBCDIC;
     skip_all_without_perlio();
-    skip_all_without_extension('Encode');
 }
 
 use strict;
index 227dc52..33283e7 100644 (file)
@@ -2,10 +2,9 @@
 
 BEGIN {
     require './test.pl';
-    skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+    skip_all_without_dynamic_extension('Encode');
     skip_all("EBCDIC") if $::IS_EBCDIC;
     skip_all_without_perlio();
-    skip_all_without_extension('Encode');
 }
 
 use strict;
index a1ca3c4..1737a67 100644 (file)
@@ -2,10 +2,9 @@
 
 BEGIN {
     require './test.pl';
-    skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+    skip_all_without_dynamic_extension('Encode');
     skip_all("EBCDIC") if $::IS_EBCDIC;
     skip_all_without_perlio();
-    skip_all_without_extension('Encode');
 }
 
 plan tests => 72;
index 344d1a8..1527471 100644 (file)
@@ -2,10 +2,9 @@
 
 BEGIN {
     require './test.pl';
-    skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+    skip_all_without_dynamic_extension('Encode');
     skip_all("EBCDIC") if $::IS_EBCDIC;
     skip_all_without_perlio();
-    skip_all_without_extension('Encode');
 }
 
 plan tests => 94;
index 90f3431..2118070 100644 (file)
@@ -6,10 +6,9 @@
 
 BEGIN {
     require './test.pl';
-    skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+    skip_all_without_dynamic_extension('Encode');
     skip_all("EBCDIC") if $::IS_EBCDIC;
     skip_all_without_perlio();
-    skip_all_without_extension('Encode');
 }
 
 use strict;
index 352684d..27daf32 100644 (file)
@@ -5,10 +5,9 @@
 
 BEGIN {
     require './test.pl';
-    skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+    skip_all_without_dynamic_extension('Encode');
     skip_all("EBCDIC") if $::IS_EBCDIC;
     skip_all_without_perlio();
-    skip_all_without_extension('Encode');
 }
 
 use strict;
index fca9d6c..290dd8c 100644 (file)
@@ -5,10 +5,9 @@
 
 BEGIN {
     require './test.pl';
-    skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+    skip_all_without_dynamic_extension('Encode');
     skip_all("EBCDIC") if $::IS_EBCDIC;
     skip_all_without_perlio();
-    skip_all_without_extension('Encode');
 }
 
 use strict;
index aa8f439..25a6753 100644 (file)
@@ -6,10 +6,9 @@
 
 BEGIN {
     require './test.pl';
-    skip_all_if_miniperl("no dynamic loading on miniperl, no Encode");
+    skip_all_without_dynamic_extension('Encode');
     skip_all("EBCDIC") if $::IS_EBCDIC;
     skip_all_without_perlio();
-    skip_all_without_extension('Encode');
 }
 
 use strict;