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