[perl #43273] Enable lib/User/*.t on cygwin
authorReini Urban <rurban@x-ray.at>
Wed, 20 Jun 2007 16:22:48 +0000 (09:22 -0700)
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>
Thu, 21 Jun 2007 08:15:24 +0000 (08:15 +0000)
From: Reini Urban (via RT) <perlbug-followup@perl.org>
Message-ID: <rt-3.6.HEAD-1276-1182381767-470.43273-75-0@perl.org>

p4raw-id: //depot/perl@31435

lib/User/grent.t
lib/User/pwent.t

index f7eb2c2..3002b6e 100644 (file)
@@ -18,7 +18,8 @@ BEGIN {
 }
 
 BEGIN {
-    our @grent = getgrgid 0; # This is the function getgrgid.
+    our $gid = $^O ne 'cygwin' ? 0 : 18;
+    our @grent = getgrgid $gid; # This is the function getgrgid.
     unless (@grent) { plan skip_all => "no gid 0"; }
 }
 
@@ -29,7 +30,7 @@ BEGIN {
 
 can_ok(__PACKAGE__, 'getgrgid');
 
-my $grent = getgrgid 0;
+my $grent = getgrgid $gid;
 
 is( $grent->name, $grent[0],    'name matches core getgrgid' );
 
index d6bd040..f93836f 100644 (file)
@@ -21,6 +21,7 @@ BEGIN {
     # On VMS getpwuid(0) may return [$gid,0] UIC info (which may not exist).
     # It is better to use the $< uid for testing on VMS instead.
     if ( $^O eq 'VMS' ) { $uid = $< ; }
+    if ( $^O eq 'cygwin' ) { $uid = 500 ; }
     our @pwent = getpwuid $uid; # This is the function getpwuid.
     unless (@pwent) { print "1..0 # Skip: no uid $uid\n"; exit 0 }
 }