source: trunk/essentials/dev-lang/perl/ext/IO/t/io_utf8.t

Last change on this file was 3181, checked in by bird, 19 years ago

perl 5.8.8

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