cvsuser 04/03/16 12:12:04
Modified: t/pmc io.t Log: Tests for peek Revision Changes Path 1.25 +35 -2 parrot/t/pmc/io.t Index: io.t =================================================================== RCS file: /cvs/public/parrot/t/pmc/io.t,v retrieving revision 1.24 retrieving revision 1.25 diff -u -w -r1.24 -r1.25 --- io.t 8 Mar 2004 00:20:09 -0000 1.24 +++ io.t 16 Mar 2004 20:12:03 -0000 1.25 @@ -1,6 +1,6 @@ #! perl -w # Copyright: 2001-2003 The Perl Foundation. All Rights Reserved. -# $Id: io.t,v 1.24 2004/03/08 00:20:09 chromatic Exp $ +# $Id: io.t,v 1.25 2004/03/16 20:12:03 scog Exp $ =head1 NAME @@ -16,7 +16,7 @@ =cut -use Parrot::Test tests => 21; +use Parrot::Test tests => 23; use Test::More; output_is(<<'CODE', <<'OUTPUT', "open/close"); @@ -376,6 +376,39 @@ CODE ok 1 Hello Parrot! +OUTPUT + +output_is(<<'CODE', <<'OUTPUT', "peek"); + open P0, "temp.file", ">" + print P0, "a line\n" + close P0 + open P0, "temp.file", "<" + peek S0, P0 + print S0 + peek S1, P0 + print S1 + print "\n" + read S2, P0, 2 + peek S3, P0 + print S3 + print "\n" + end +CODE +aa +l +OUTPUT + +output_is(<<'CODE', <<'OUTPUT', "peek on an empty file"); + open P0, "temp.file", ">" + close P0 + open P0, "temp.file", "<" + peek S0, P0 + eq S0, "", OK1 + print "not " +OK1: print "ok 1\n" + end +CODE +ok 1 OUTPUT unlink "temp.file";
