Move the ext/IO tests to a more standard location so that
[p5sagit/p5-mst-13.2.git] / ext / IO / t / io_utf8.t
1 #!./perl
2
3 BEGIN {
4     chdir 't' if -d 't';
5     @INC = '../lib';
6     unless (find PerlIO::Layer 'perlio') {
7         print "1..0 # Skip: not perlio\n";
8         exit 0;
9     }
10 }
11
12 require "./test.pl";
13
14 plan(tests => 5);
15
16 my $io;
17
18 use_ok('IO::File');
19
20 $io = IO::File->new;
21
22 ok($io->open("io_utf8", ">:utf8"), "open >:utf8");
23 ok((print $io chr(256)), "print chr(256)");
24 undef $io;
25
26 $io = IO::File->new;
27 ok($io->open("io_utf8", "<:utf8"), "open <:utf8");
28 is(ord(<$io>), 256, "readline chr(256)");
29 undef $io;
30
31 END {
32   1 while unlink "io_utf8";
33 }