Commit | Line | Data |
---|---|---|
e940ddbb NC |
1 | #!./perl -w |
2 | ||
3 | BEGIN { | |
4 | chdir 't' if -d 't'; | |
69026470 | 5 | @INC = qw(. ../lib); |
b5fe5ca2 | 6 | require './test.pl'; |
3d273761 NC |
7 | eval 'use Errno'; |
8 | die $@ if $@ and !is_miniperl(); | |
e940ddbb NC |
9 | } |
10 | ||
3d273761 | 11 | |
b5fe5ca2 | 12 | plan(tests => 9); |
69026470 | 13 | |
e940ddbb | 14 | ok( binmode(STDERR), 'STDERR made binary' ); |
3d273761 NC |
15 | SKIP: { |
16 | skip('skip unix discipline without PerlIO layers', 1) | |
17 | unless find PerlIO::Layer 'perlio'; | |
18 | ok( binmode(STDERR, ":unix"), ' with unix discipline' ); | |
444e39b5 | 19 | } |
e940ddbb NC |
20 | ok( binmode(STDERR, ":raw"), ' raw' ); |
21 | ok( binmode(STDERR, ":crlf"), ' and crlf' ); | |
22 | ||
23 | # If this one fails, we're in trouble. So we just bail out. | |
24 | ok( binmode(STDOUT), 'STDOUT made binary' ) || exit(1); | |
3d273761 NC |
25 | SKIP: { |
26 | skip('skip unix discipline without PerlIO layers', 1) | |
27 | unless find PerlIO::Layer 'perlio'; | |
28 | ok( binmode(STDOUT, ":unix"), ' with unix discipline' ); | |
444e39b5 NC |
29 | } |
30 | ok( binmode(STDOUT, ":raw"), ' raw' ); | |
31 | ok( binmode(STDOUT, ":crlf"), ' and crlf' ); | |
b5fe5ca2 SR |
32 | |
33 | SKIP: { | |
3d273761 | 34 | skip "no EBADF", 1 unless exists &Errno::EBADF; |
b5fe5ca2 | 35 | |
013b78e8 | 36 | no warnings 'io', 'once'; |
b5fe5ca2 SR |
37 | $! = 0; |
38 | binmode(B); | |
3d273761 | 39 | cmp_ok($!, '==', Errno::EBADF()); |
b5fe5ca2 | 40 | } |