This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The value from caller doesn't change, so my $pkg = caller;
[perl5.git] / lib / open.t
index 3f0fdf2..554798b 100644 (file)
@@ -7,7 +7,7 @@ BEGIN {
        require Config; import Config;
 }
 
-use Test::More tests => 17;
+use Test::More tests => 16;
 
 # open::import expects 'open' as its first argument, but it clashes with open()
 sub import {
@@ -43,16 +43,10 @@ eval q{ use warnings 'layer'; use open IN => ':macguffin' ; };
 like( $warn, qr/Unknown PerlIO layer/,
        'should warn about unknown layer with bad layer provided' );
 
-SKIP: {
-    skip("no perlio, no :utf8", 1) unless (find PerlIO::Layer 'perlio');
-    # now load a real-looking locale
-    $ENV{LC_ALL} = ' .utf8';
-    import( 'IN', 'locale' );
-    like( ${^OPEN}, qr/^(:utf8)?:utf8\0/,
-        'should set a valid locale layer' );
-}
+# open :locale logic changed since open 1.04, new logic
+# difficult to test portably.
 
-# and see if it sets the magic variables appropriately
+# see if it sets the magic variables appropriately
 import( 'IN', ':crlf' );
 ok( $^H & $open::hint_bits,
        'hint bits should be set in $^H after open import' );
@@ -175,9 +169,9 @@ SKIP: {
     skip("no perlio", 1) unless (find PerlIO::Layer 'perlio');
     use open IN => ':non-existent';
     eval {
-       require Anything;
+       require Symbol; # Anything that exists but we havn't loaded
     };
-    like($@, qr/Recursive call/i,
+    like($@, qr/Can't locate Symbol|Recursive call/i,
         "test for an endless loop in PerlIO_find_layer");
 }