Add a test for [perl #17753].
[p5sagit/p5-mst-13.2.git] / t / io / layers.t
index 1596d72..6eb0656 100644 (file)
@@ -4,15 +4,23 @@ BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
     require './test.pl';
+    unless (find PerlIO::Layer 'perlio') {
+       print "1..0 # Skip: not perlio\n";
+       exit 0;
+    }
+    if (exists $ENV{PERLIO} && $ENV{PERLIO} ne 'stdio') {
+       print "1..0 # PERLIO non-stdio\n";
+       exit(0);
+    }
 }
 
 plan tests => 43;
 
 use Config;
 
-{
-    skip("This perl does not have perlio and Encode", 43)
-       unless $Config{useperlio} && " $Config{extensions} " =~ / Encode /;
+SKIP: {
+    skip("This perl does not have Encode", 43)
+       unless " $Config{extensions} " =~ / Encode /;
 
     sub check {
        my ($result, $expected, $id) = @_;
@@ -98,6 +106,7 @@ use Config;
 
     {
        use open(IN => ":crlf", OUT => ":encoding(cp1252)");
+
        open F, "<afile";
        open G, ">afile";