stat.t revision 7c478bd95313f5f23a4c958a745db2134aa03244
#!./perl
# $RCSfile: stat.t,v $$Revision: 4.1 $$Date: 92/08/07 18:28:28 $
BEGIN {
chdir 't' if -d 't';
}
use Config;
print "1..59\n";
# hack to make Apollo update link count:
print "ok 1\n";
}
else {
}
print "ok 2\n";
}
else {
}
sleep 3 if $funky_FAT_timestamps;
} else {
print "# open failed: $!\nnot ok 1\nnot ok 2\n";
}
else {
}
if ($Is_Dosish || $Config{dont_use_nlink})
{print "ok 3 # skipped: no link count\n";}
elsif ($nlink == 2)
{print "ok 3\n";}
else {print "# \$nlink is |$nlink|\nnot ok 3\n";}
if ( $Is_Dosish
# Solaris tmpfs bug
|| $cwd =~ m#/afs/#
}
print "ok 4\n";
}
else {
print "not ok 4\n";
print "#4 of some sort. Building in /tmp sometimes has this problem.\n";
print "#4 Also building on the ClearCase VOBS filesystem may cause this failure.\n";
}
$olduid = $>; # can't test -r if uid == 0
eval '$> = 1;'; # so switch uid (may not be implemented)
eval '$> = $olduid;'; # switch uid back (may not be implemented)
else {print "not ok 11\n";}
foreach ((12,13,14,15,16,17)) {
print "ok $_\n"; #deleted tests
}
# in ms windows, Op.stat.tmp inherits owner uid from directory
# not sure about os/2, but chown is harmless anyway
else {print "not ok 20\n";}
if (-d '.') {print "ok 23\n";} else {print "not ok 23\n";}
if (! -f '.') {print "ok 24\n";} else {print "not ok 24\n";}
if (-l 'perl') {print "ok 25\n";} else {print "not ok 25\n";}
}
else {
print "ok 25\n";
}
if ($Is_MSWin32 || $Is_Dos)
{print "ok 29\n";}
{print "ok 29\n";}
elsif (-c "/dev/$1")
{print "ok 29\n";}
else
{print "not ok 29\n";}
if (! -c '.') {print "ok 30\n";} else {print "not ok 30\n";}
if ($Is_MSWin32 || $Is_Dos)
{print "ok 31\n";}
{print "ok 31\n";}
elsif (-S "/dev/$1")
{print "ok 31\n";}
else
{print "not ok 31\n";}
if (! -S '.') {print "ok 32\n";} else {print "not ok 32\n";}
if ($Is_MSWin32 || $Is_Dos)
{print "ok 33\n";}
{print "ok 33\n";}
elsif (-b "/dev/$1")
{print "ok 33\n";}
else
{print "not ok 33\n";}
if (! -b '.') {print "ok 34\n";} else {print "not ok 34\n";}
}
$cnt++;
$uid++ if -u;
}
}
# I suppose this is going to fail somewhere...
{print "ok 35\n";}
else
# may not be available (at, cron rsh etc), the PERL_SKIP_TTY_TEST env var
# can be set to skip the tests that need a tty.
print "ok 36\n";
print "ok 37\n";
}
else {
}
} else { # if some platform completely undefines $TTY
print "ok 36 # skipped\n";
print "ok 37 # skipped\n";
}
}
if (-t) {print "ok 39\n";} else {print "not ok 39\n";}
}
else {
print "ok 36\n";
print "ok 37\n";
print "ok 38\n";
print "ok 39\n";
}
{print "ok 40\n";} else {print "not ok 40\n";}
# These aren't strictly "stat" calls, but so what?
print "# $@";
for (45 .. 54) {
print "ok $_\n";
}
}
else {
$_ = <FOO>;
$_ = <FOO>;
}
# and now, a few parsing tests:
if (-f) {print "ok 57\n";} else {print "not ok 57\n";}
if (-f()) {print "ok 58\n";} else {print "not ok 58\n";}
# bug id 20011101.069
if (@r == 13) { print "ok 59\n" } else { print "not ok 59\n" }