From: Nicholas Clark Date: Wed, 29 Dec 2004 16:28:58 +0000 (+0000) Subject: Convert op/read.t to use test.pl and make it stricture compliant. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1a24607be0396341b3fbd5ae8b8d3d1bd7ba728e;p=p5sagit%2Fp5-mst-13.2.git Convert op/read.t to use test.pl and make it stricture compliant. p4raw-id: //depot/perl@23701 --- diff --git a/t/op/read.t b/t/op/read.t index cfa0103..aaa426d 100755 --- a/t/op/read.t +++ b/t/op/read.t @@ -2,18 +2,25 @@ # $RCSfile: read.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:17 $ -print "1..4\n"; +BEGIN { + chdir 't'; + @INC = '../lib'; + require './test.pl'; +} +use strict; +plan tests => 4; open(FOO,'op/read.t') || open(FOO,'t/op/read.t') || open(FOO,':op:read.t') || die "Can't open op.read"; -seek(FOO,4,0); -$got = read(FOO,$buf,4); +seek(FOO,4,0) or die "Seek failed: $!"; +my $buf; +my $got = read(FOO,$buf,4); -print ($got == 4 ? "ok 1\n" : "not ok 1\n"); -print ($buf eq "perl" ? "ok 2\n" : "not ok 2 :$buf:\n"); +is ($got, 4); +is ($buf, "perl"); seek (FOO,0,2) || seek(FOO,20000,0); $got = read(FOO,$buf,4); -print ($got == 0 ? "ok 3\n" : "not ok 3\n"); -print ($buf eq "" ? "ok 4\n" : "not ok 4\n"); +is ($got, 0); +is ($buf, "");