Integrate from mainperl.
[p5sagit/p5-mst-13.2.git] / t / op / stat.t
index 6a5776d..ae627f6 100755 (executable)
@@ -13,7 +13,7 @@ print "1..58\n";
 
 $Is_MSWin32 = $^O eq 'MSWin32';
 $Is_Dos = $^O eq 'dos';
-$Is_Dosish = $Is_Dos || $^O eq 'os2' || $Is_MSWin32;
+$Is_Dosish = $Is_Dos || $^O eq 'os2' || $Is_MSWin32 || $^O =~ /cygwin/;
 chop($cwd = ($Is_MSWin32 ? `cd` : `pwd`));
 
 $DEV = `ls -l /dev` unless $Is_Dosish;
@@ -93,6 +93,9 @@ 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
+chown $>,'Op.stat.tmp';
 chmod 0700,'Op.stat.tmp';
 if (-r 'Op.stat.tmp') {print "ok 18\n";} else {print "not ok 18\n";}
 if (-w 'Op.stat.tmp') {print "ok 19\n";} else {print "not ok 19\n";}
@@ -195,6 +198,9 @@ unless($ENV{PERL_SKIP_TTY_TEST}) {
            if (-t TTY) {print "ok 36\n";} else {print "not ok 36\n";}
            if (-c TTY) {print "ok 37\n";} else {print "not ok 37\n";}
            close(TTY);
+       } else { # if some platform completely undefines $TTY
+           print "ok 36 # skipped\n";
+           print "ok 37 # skipped\n";
        }
     }
     if (! -t TTY) {print "ok 38\n";} else {print "not ok 38\n";}