From: Jarkko Hietaniemi Date: Tue, 4 Mar 2003 05:33:50 +0000 (+0000) Subject: Try to give rcatline() a good jog on Unicode. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b5d30a8477a61b970a31cbc1a3c71ed99cd88a26;p=p5sagit%2Fp5-mst-13.2.git Try to give rcatline() a good jog on Unicode. p4raw-id: //depot/perl@18823 --- diff --git a/t/io/utf8.t b/t/io/utf8.t index 78bd685..edf5fdd 100755 --- a/t/io/utf8.t +++ b/t/io/utf8.t @@ -12,7 +12,7 @@ BEGIN { no utf8; # needed for use utf8 not griping about the raw octets $| = 1; -print "1..33\n"; +print "1..49\n"; open(F,"+>:utf8",'a'); print F chr(0x100).'£'; @@ -295,6 +295,36 @@ print "ok 26\n"; close F; } +{ + my @a = ( [ 0x007F, "bytes" ], + [ 0x0080, "bytes" ], + [ 0x0080, "utf8" ], + [ 0x0100, "utf8" ] ); + my $t = 34; + for my $u (@a) { + for my $v (@a) { + # print "# @$u - @$v\n"; + open F, ">a"; + binmode(F, ":" . $u->[1]); + print F chr($u->[0]); + close F; + + open F, "[1]); + + my $s = chr($v->[0]); + utf8::upgrade($s) if $v->[1] eq "utf8"; + + $s .= ; + print $s eq chr($v->[0]) . chr($u->[0]) ? + "ok $t # rcatline utf8\n" : "not ok $t # rcatline utf8\n"; + close F; + $t++; + } + } + # last test here 47 +} + # sysread() and syswrite() tested in lib/open.t since Fnctl is used END {