summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReini Urban <rurban@x-ray.at>2014-06-09 16:55:09 +1000
committerTony Cook <tony@develop-help.com>2014-06-10 10:16:19 +1000
commit683267f66c72ee510f225a18dc9cd0e4c1962532 (patch)
tree10204afd2c83246e71e973ce5170ef7edb444a9c
parent1c96ee576a7e698096ced8a1174544a8e77247f8 (diff)
downloadperl-683267f66c72ee510f225a18dc9cd0e4c1962532.tar.gz
[perl #121732] fix t/op/filetest.t for windows
Tony: fix for minitest
-rw-r--r--t/op/filetest.t14
1 files changed, 13 insertions, 1 deletions
diff --git a/t/op/filetest.t b/t/op/filetest.t
index a67b73f3ce..7316442eb8 100644
--- a/t/op/filetest.t
+++ b/t/op/filetest.t
@@ -11,6 +11,10 @@ BEGIN {
plan(tests => 53 + 27*14);
+if ($^O =~ /MSWin32|cygwin|msys/ && !is_miniperl) {
+ require Win32; # for IsAdminUser()
+}
+
# Tests presume we are in t/op directory and that file 'TEST' is found
# therein.
is(-d 'op', 1, "-d: directory correctly identified");
@@ -31,7 +35,15 @@ chmod 0555, $ro_empty_file or die "chmod 0555, '$ro_empty_file' failed: $!";
SKIP: {
my $restore_root;
- if ($> == 0) {
+ skip "Need Win32::IsAdminUser() on $^O", 1
+ if $^O =~ /MSWin32|cygwin|msys/ && is_miniperl();
+ my $Is_WinAdminUser = ($^O =~ /MSWin32|cygwin|msys/ and Win32::IsAdminUser()) ? 1 : 0;
+ # TODO: skip("On an ACL filesystem like $^O we cannot rely on -w via uid/gid");
+ # We have no filesystem check for ACL in core
+ if ($Is_WinAdminUser) {
+ skip("As Windows Administrator we cannot rely on -w via uid/gid");
+ }
+ elsif ($> == 0) {
# root can read and write anything, so switch uid (may not be
# implemented)
eval '$> = 1';