tell.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
# $RCSfile: tell.t,v $$Revision$$Date$
BEGIN {
chdir 't' if -d 't';
}
print "1..28\n";
$TST = 'tst';
$^O =~ /^uwin/);
$firstline = <$TST>;
$secondpos = tell;
$x = 0;
while (<tst>) {
}
if ($x == 1) { print "ok 2\n"; } else { print "not ok 2\n"; }
if ($. == 0) { print "not ok 14\n"; } else { print "ok 14\n"; }
$curline = $.;
{
local($.);
if ($. == 0) { print "not ok 15\n"; } else { print "ok 15\n"; }
if ($. == 0) { print "ok 16\n"; } else { print "not ok 16\n"; }
$. = 5;
if ($. == 6) { print "ok 17\n"; } else { print "not ok 17\n"; }
}
{
local($.);
if ($. == 7) { print "ok 19\n"; } else { print "not ok 19\n"; }
}
{
local($.);
if ($. == 7) { print "ok 21\n"; } else { print "not ok 21\n"; }
}
# ftell(STDIN) (or any std streams) is undefined, it can return -1 or
# something else. ftell() on pipes, fifos, and sockets is defined to
# return -1.
my $written = "tell_write.txt";
binmode $tst if $Is_Dosish;
binmode $tst if $Is_Dosish;
if (0)
{
# :stdio does not pass these so ignore them for now
}
{ print "ok 27\n"; } else { print "not ok 27\n"; }
{ print "ok 28\n"; } else { print "not ok 28\n"; }