Integrate mainline
[p5sagit/p5-mst-13.2.git] / t / io / binmode.t
1 #!./perl -w
2
3 BEGIN {
4     chdir 't' if -d 't';
5     @INC = qw(. ../lib);
6 }
7
8 use Config;
9
10 require "test.pl";
11 plan(tests => 8);
12
13 ok( binmode(STDERR),            'STDERR made binary' );
14 if (find PerlIO::Layer 'perlio') {
15   ok( binmode(STDERR, ":unix"),   '  with unix discipline' );
16 } else {
17   ok(1,   '  skip unix discipline without PerlIO layers' );
18 }
19 ok( binmode(STDERR, ":raw"),    '  raw' );
20 ok( binmode(STDERR, ":crlf"),   '  and crlf' );
21
22 # If this one fails, we're in trouble.  So we just bail out.
23 ok( binmode(STDOUT),            'STDOUT made binary' )      || exit(1);
24 if (find PerlIO::Layer 'perlio') {
25   ok( binmode(STDOUT, ":unix"),   '  with unix discipline' );
26 } else {
27   ok(1,   '  skip unix discipline without PerlIO layers' );
28 }
29 ok( binmode(STDOUT, ":raw"),    '  raw' );
30 ok( binmode(STDOUT, ":crlf"),   '  and crlf' );