This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/io/binmode.t
[perl5.git] / t / io / binmode.t
CommitLineData
e940ddbb
NC
1#!./perl -w
2
3BEGIN {
4 chdir 't' if -d 't';
5 @INC = '../lib';
6}
7
e940ddbb 8use Test::More tests => 8;
444e39b5 9use Config;
e940ddbb
NC
10
11ok( binmode(STDERR), 'STDERR made binary' );
444e39b5
NC
12if ($Config{useperlio}) {
13 ok( binmode(STDERR, ":unix"), ' with unix discipline' );
14} else {
15 ok(1, ' skip unix discipline for -Uuseperlio' );
16}
e940ddbb
NC
17ok( binmode(STDERR, ":raw"), ' raw' );
18ok( binmode(STDERR, ":crlf"), ' and crlf' );
19
20# If this one fails, we're in trouble. So we just bail out.
21ok( binmode(STDOUT), 'STDOUT made binary' ) || exit(1);
444e39b5
NC
22if ($Config{useperlio}) {
23 ok( binmode(STDOUT, ":unix"), ' with unix discipline' );
24} else {
25 ok(1, ' skip unix discipline for -Uuseperlio' );
26}
27ok( binmode(STDOUT, ":raw"), ' raw' );
28ok( binmode(STDOUT, ":crlf"), ' and crlf' );