Commit | Line | Data |
a687059c |
1 | #!./perl |
2 | |
79072805 |
3 | # $RCSfile: read.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:17 $ |
a687059c |
4 | |
1a24607b |
5 | BEGIN { |
6 | chdir 't'; |
7 | @INC = '../lib'; |
8 | require './test.pl'; |
9 | } |
10 | use strict; |
a687059c |
11 | |
1a24607b |
12 | plan tests => 4; |
a687059c |
13 | |
dc459aad |
14 | open(FOO,'op/read.t') || open(FOO,'t/op/read.t') || open(FOO,':op:read.t') || die "Can't open op.read"; |
1a24607b |
15 | seek(FOO,4,0) or die "Seek failed: $!"; |
16 | my $buf; |
17 | my $got = read(FOO,$buf,4); |
a687059c |
18 | |
1a24607b |
19 | is ($got, 4); |
20 | is ($buf, "perl"); |
a687059c |
21 | |
a0d0e21e |
22 | seek (FOO,0,2) || seek(FOO,20000,0); |
a687059c |
23 | $got = read(FOO,$buf,4); |
24 | |
1a24607b |
25 | is ($got, 0); |
26 | is ($buf, ""); |