summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2003-03-04 05:33:50 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2003-03-04 05:33:50 +0000
commitb5d30a8477a61b970a31cbc1a3c71ed99cd88a26 (patch)
tree34ca3e45899262b2480e803e35c7034a69f61296 /t
parentefd8b2bacfee8a05a6684f052b8bf5610dd1fa01 (diff)
downloadperl-b5d30a8477a61b970a31cbc1a3c71ed99cd88a26.tar.gz
Try to give rcatline() a good jog on Unicode.
p4raw-id: //depot/perl@18823
Diffstat (limited to 't')
-rwxr-xr-xt/io/utf8.t32
1 files changed, 31 insertions, 1 deletions
diff --git a/t/io/utf8.t b/t/io/utf8.t
index 78bd685bb1..edf5fddb74 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, "<a";
+ binmode(F, ":" . $u->[1]);
+
+ my $s = chr($v->[0]);
+ utf8::upgrade($s) if $v->[1] eq "utf8";
+
+ $s .= <F>;
+ 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 {