X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fop%2Fstat.t;h=70ab5a321c675c3fb3695e11f868bd71d935281f;hb=01b3578752f17209014eae7d693a93093779daac;hp=89046c364b12cfeec42021d2bf31cde16bb0675a;hpb=085a16fc645d01e9c317a227fb12575af270d8fb;p=p5sagit%2Fp5-mst-13.2.git diff --git a/t/op/stat.t b/t/op/stat.t index 89046c3..70ab5a3 100755 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -9,7 +9,7 @@ BEGIN { use Config; use File::Spec; -plan tests => 73; +plan tests => 82; my $Perl = which_perl(); @@ -25,6 +25,8 @@ $Is_OS2 = $^O eq 'os2'; $Is_Solaris = $^O eq 'solaris'; $Is_VMS = $^O eq 'VMS'; $Is_DGUX = $^O eq 'dgux'; +$Is_MPRAS = $^O =~ /svr4/ && -f '/etc/.relid'; +$Is_Rhapsody= $^O eq 'rhapsody'; $Is_Dosish = $Is_Dos || $Is_OS2 || $Is_MSWin32 || $Is_NetWare || $Is_Cygwin; @@ -40,7 +42,7 @@ my $tmpfile = 'Op_stat.tmp'; my $tmpfile_link = $tmpfile.'2'; -unlink $tmpfile; +1 while unlink $tmpfile; open(FOO, ">$tmpfile") || DIE("Can't open temp test file: $!"); close FOO; @@ -69,7 +71,7 @@ sleep 3 if $funky_FAT_timestamps; print FOO "Now is the time for all good men to come to.\n"; close(FOO); -sleep 2 unless $funky_FAT_timestamps; +sleep 2; SKIP: { @@ -111,10 +113,11 @@ SKIP: { !isnt($mtime, $ctime, 'hard link ctime != mtime') ) { print STDERR < $f"), 'can create tmp file'); +close S or die; +my @a = stat $f; +print "# time=$^T, stat=(@a)\n"; +my @b = (-M _, -A _, -C _); +print "# -MAC=(@b)\n"; +ok( (-M _) < 0, 'negative -M works'); +ok( (-A _) < 0, 'negative -A works'); +ok( (-C _) < 0, 'negative -C works'); +ok(unlink($f), 'unlink tmp file'); + +{ + ok(open(F, ">", $tmpfile), 'can create temp file'); + close F; + chmod 0077, $tmpfile; + my @a = stat($tmpfile); + my $s1 = -s _; + -T _; + my $s2 = -s _; + is($s1, $s2, q(-T _ doesn't break the statbuffer)); + unlink $file; +} + +END { + 1 while unlink $tmpfile; +}