Commit | Line | Data |
73829507 |
1 | #!./perl |
2 | |
3 | BEGIN { |
35a60386 |
4 | unless(grep /blib/, @INC) { |
5 | chdir 't' if -d 't'; |
6 | @INC = '../lib'; |
7 | } |
8 | unless ($] >= 5.008 and find PerlIO::Layer 'perlio') { |
73829507 |
9 | print "1..0 # Skip: not perlio\n"; |
10 | exit 0; |
11 | } |
12 | } |
13 | |
35a60386 |
14 | require($ENV{PERL_CORE} ? "./test.pl" : "./t/test.pl"); |
73829507 |
15 | |
16 | plan(tests => 5); |
17 | |
18 | my $io; |
19 | |
20 | use_ok('IO::File'); |
21 | |
22 | $io = IO::File->new; |
23 | |
24 | ok($io->open("io_utf8", ">:utf8"), "open >:utf8"); |
25 | ok((print $io chr(256)), "print chr(256)"); |
26 | undef $io; |
27 | |
28 | $io = IO::File->new; |
29 | ok($io->open("io_utf8", "<:utf8"), "open <:utf8"); |
30 | is(ord(<$io>), 256, "readline chr(256)"); |
31 | undef $io; |
32 | |
33 | END { |
34 | 1 while unlink "io_utf8"; |
35 | } |