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