This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Perl 5.22.1-RC4 today
[perl5.git] / lib / User / pwent.t
index 853526c..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 }
 }
@@ -34,9 +35,13 @@ print "ok 1\n";
 my $pwent = getpwuid $uid; # This is the OO getpwuid.
 
 my $uid_expect = $uid;
-if ( $^O eq 'cygwin' ) { $uid_expect = 500; } # go figure
-
-print "not " unless $pwent->uid    == $uid_expect ;
+if ( $^O eq 'cygwin' ) {
+    print "not " unless (   $pwent->uid == $uid_expect
+                         || $pwent->uid == 500         );  # go figure
+}
+else {
+    print "not " unless $pwent->uid    == $uid_expect ;
+}
 print "ok 2\n";
 
 print "not " unless $pwent->name   eq $pwent[0];