Perl 5.8.3 patches from the BS2000 port - part 2
[p5sagit/p5-mst-13.2.git] / t / io / read.t
CommitLineData
93c1eb4f 1#!./perl
2
3# $RCSfile$
4
b5fe5ca2 5BEGIN {
6 chdir 't' if -d 't';
7 @INC = '../lib';
8 require './test.pl';
9}
10
11use strict;
12use Errno;
13
14plan tests => 2;
93c1eb4f 15
16open(A,"+>a");
17print A "_";
18seek(A,0,0);
19
b5fe5ca2 20my $b = "abcd";
93c1eb4f 21$b = "";
22
23read(A,$b,1,4);
24
25close(A);
26
55497cff 27unlink("a");
28
b5fe5ca2 29is($b,"\000\000\000\000_"); # otherwise probably "\000bcd_"
55497cff 30
31unlink 'a';
b5fe5ca2 32
33SKIP: {
34 skip "no EBADF", 1 if (!exists &Errno::EBADF);
35
36 $! = 0;
37 read(B,$b,1);
38 ok($! == &Errno::EBADF);
39}