Convert op/read.t to use test.pl and make it stricture compliant.
[p5sagit/p5-mst-13.2.git] / t / op / read.t
1 #!./perl
2
3 # $RCSfile: read.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:17 $
4
5 BEGIN {
6     chdir 't';
7     @INC = '../lib';
8     require './test.pl';
9 }
10 use strict;
11
12 plan tests => 4;
13
14 open(FOO,'op/read.t') || open(FOO,'t/op/read.t') || open(FOO,':op:read.t') || die "Can't open op.read";
15 seek(FOO,4,0) or die "Seek failed: $!";
16 my $buf;
17 my $got = read(FOO,$buf,4);
18
19 is ($got, 4);
20 is ($buf, "perl");
21
22 seek (FOO,0,2) || seek(FOO,20000,0);
23 $got = read(FOO,$buf,4);
24
25 is ($got, 0);
26 is ($buf, "");