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 {
};
# 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' );
# 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' );
}