X-Git-Url: https://perl5.git.perl.org/perl5.git/blobdiff_plain/526904c795caa76480cb49ae82254581cfc55501..14f229c7b15e7b1605725291877187b9c622eb57:/t/op/stat.t diff --git a/t/op/stat.t b/t/op/stat.t index e0ce03b..5ad119c 100644 --- a/t/op/stat.t +++ b/t/op/stat.t @@ -195,10 +195,8 @@ SKIP: { # Going to try to switch away from root. Might not work. my $olduid = $>; eval { $> = 1; }; - skip "Can't test if an admin user in miniperl", 2, - if $Is_Cygwin && is_miniperl(); skip "Can't test -r or -w meaningfully if you're superuser", 2 - if ($> == 0); + if ($Is_Cygwin ? _ingroup(544, 1) : $> == 0); SKIP: { skip "Can't test -r meaningfully?", 1 if $Is_Dos; @@ -650,3 +648,17 @@ END { chmod 0666, $tmpfile; unlink_all $tmpfile; } + +sub _ingroup { + my ($gid, $eff) = @_; + + $^O eq "VMS" and return $_[0] == $); + + my ($egid, @supp) = split " ", $); + my ($rgid) = split " ", $(; + + $gid == ($eff ? $egid : $rgid) and return 1; + grep $gid == $_, @supp and return 1; + + return ""; +}