diff options
Diffstat (limited to 't/op/filetest.t')
-rw-r--r-- | t/op/filetest.t | 14 |
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'; |