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