Sync with libnet-1.11
[p5sagit/p5-mst-13.2.git] / lib / open.t
index 5897c2b..d9d385b 100644 (file)
@@ -6,7 +6,7 @@ BEGIN {
        require Config; import Config;
 }
 
-use Test::More tests => 15;
+use Test::More tests => 16;
 
 # open::import expects 'open' as its first argument, but it clashes with open()
 sub import {
@@ -32,7 +32,13 @@ local $SIG{__WARN__} = sub {
 };
 
 # and it shouldn't be able to find this discipline
-eval{ import( 'IN', 'macguffin' ) };
+$warn = '';
+eval q{ no warnings 'layer'; use open IN => ':macguffin' ; };
+is( $warn, '',
+       'should not warn about unknown discipline with bad discipline provided' );
+
+$warn = '';
+eval q{ use warnings 'layer'; use open IN => ':macguffin' ; };
 like( $warn, qr/Unknown discipline layer/, 
        'should warn about unknown discipline with bad discipline provided' );
 
@@ -41,7 +47,7 @@ SKIP: {
     # now load a real-looking locale
     $ENV{LC_ALL} = ' .utf8';
     import( 'IN', 'locale' );
-    is( ${^OPEN}, ":utf8\0", 
+    like( ${^OPEN}, qr/^(:utf8)?:utf8\0/,
         'should set a valid locale layer' );
 }