1N/A#!./perl -w
1N/A
1N/ABEGIN {
1N/A chdir 't' if -d 't';
1N/A @INC = qw(. ../lib);
1N/A require './test.pl';
1N/A}
1N/A
1N/Ause Config;
1N/ABEGIN {
1N/A eval {require Errno; Errno->import;};
1N/A}
1N/Aplan(tests => 9);
1N/A
1N/Aok( binmode(STDERR), 'STDERR made binary' );
1N/Aif (find PerlIO::Layer 'perlio') {
1N/A ok( binmode(STDERR, ":unix"), ' with unix discipline' );
1N/A} else {
1N/A ok(1, ' skip unix discipline without PerlIO layers' );
1N/A}
1N/Aok( binmode(STDERR, ":raw"), ' raw' );
1N/Aok( binmode(STDERR, ":crlf"), ' and crlf' );
1N/A
1N/A# If this one fails, we're in trouble. So we just bail out.
1N/Aok( binmode(STDOUT), 'STDOUT made binary' ) || exit(1);
1N/Aif (find PerlIO::Layer 'perlio') {
1N/A ok( binmode(STDOUT, ":unix"), ' with unix discipline' );
1N/A} else {
1N/A ok(1, ' skip unix discipline without PerlIO layers' );
1N/A}
1N/Aok( binmode(STDOUT, ":raw"), ' raw' );
1N/Aok( binmode(STDOUT, ":crlf"), ' and crlf' );
1N/A
1N/ASKIP: {
1N/A skip "minitest", 1 if $ENV{PERL_CORE_MINITEST};
1N/A skip "no EBADF", 1 if (!exists &Errno::EBADF);
1N/A
1N/A no warnings 'io';
1N/A $! = 0;
1N/A binmode(B);
1N/A ok($! == &Errno::EBADF);
1N/A}