Change 13073 by jhi@alpha on 2001/11/18 16:16:17

        Add test for sysread().

Affected files ...

.... //depot/perl/t/io/utf8.t#17 edit

Differences ...

==== //depot/perl/t/io/utf8.t#17 (xtext) ====
Index: perl/t/io/utf8.t
--- perl/t/io/utf8.t.~1~        Sun Nov 18 09:30:05 2001
+++ perl/t/io/utf8.t    Sun Nov 18 09:30:05 2001
@@ -12,7 +12,7 @@
 no utf8; # needed for use utf8 not griping about the raw octets
 
 $| = 1;
-print "1..26\n";
+print "1..27\n";
 
 open(F,"+>:utf8",'a');
 print F chr(0x100).'�';
@@ -210,4 +210,22 @@
 close F;
 print "ok 26\n";
 
+open F, "<:utf8", "a";
+$a = 0;
+for (@a) {
+    unless (sysread(F, $b, 1) == 1  &&
+            length($b)        == 1  &&
+            ord($b)           == ord($_) &&
+            tell(F)           == ($a += bytes::length($b))) {
+        print '# ord($_)    == ', ord($_), "\n";
+        print '# ord($b)    == ', ord($b), "\n";
+        print '# length($b) == ', length($b), "\n";
+        print '# tell(F)    == ', tell(F), "\n";
+        print "not ";
+        last;
+    }
+}
+close F;
+print "ok 27\n";
+
 END { 1 while unlink "a" }
End of Patch.

Reply via email to