Integrate mainline
[p5sagit/p5-mst-13.2.git] / t / io / binmode.t
CommitLineData
e940ddbb 1#!./perl -w
2
3BEGIN {
4 chdir 't' if -d 't';
69026470 5 @INC = qw(. ../lib);
e940ddbb 6}
7
444e39b5 8use Config;
e940ddbb 9
69026470 10require "test.pl";
11plan(tests => 8);
12
e940ddbb 13ok( binmode(STDERR), 'STDERR made binary' );
6b5da1a3 14if (find PerlIO::Layer 'perlio') {
444e39b5 15 ok( binmode(STDERR, ":unix"), ' with unix discipline' );
16} else {
6b5da1a3 17 ok(1, ' skip unix discipline without PerlIO layers' );
444e39b5 18}
e940ddbb 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);
6b5da1a3 24if (find PerlIO::Layer 'perlio') {
444e39b5 25 ok( binmode(STDOUT, ":unix"), ' with unix discipline' );
26} else {
6b5da1a3 27 ok(1, ' skip unix discipline without PerlIO layers' );
444e39b5 28}
29ok( binmode(STDOUT, ":raw"), ' raw' );
30ok( binmode(STDOUT, ":crlf"), ' and crlf' );