[patch: perl@8211]VMS: add -Duseperlio capacity to configure.com
[p5sagit/p5-mst-13.2.git] / t / op / groups.t
index d22d8f0..082d2d1 100755 (executable)
@@ -10,7 +10,7 @@ sub quit {
     exit 0;
 }
 
-quit() if $^O eq 'MSWin32';
+quit() if $^O eq 'MSWin32' or $^O =~ /lynxos/i;
 
 # We have to find a command that prints all (effective
 # and real) group names (not ids).  The known commands are:
@@ -65,6 +65,11 @@ EOM
     quit();
 }
 
+unless (eval { getgrgid(0); 1 }) {
+    print "1..0 # Skip: getgrgid() not implemented\n";
+    exit 0;
+}
+
 # Remember that group names can contain whitespace, '-', et cetera.
 # That is: do not \w, do not \S.
 if ($groups =~ /groups=(.+)( [ug]id=|$)/) {
@@ -74,11 +79,11 @@ if ($groups =~ /groups=(.+)( [ug]id=|$)/) {
     # prefer names over numbers
     for (@g0) {
         # 42(zot me)
-       if (/^(\d+)(?:\(([^)]+)\))?$/) {
+       if (/^(\d+)(?:\(([^)]+)\))?/) {
            push @g1, ($2 || $1);
        }
         # zot me(42)
-       elsif (/^([^(]*)\((\d+)\)$/) {
+       elsif (/^([^(]*)\((\d+)\)/) {
            push @g1, ($1 || $2);
        }
        else {
@@ -110,7 +115,8 @@ for (split(' ', $()) {
     }
 } 
 
-if ($^O eq "uwin") { # Or anybody else who can have spaces in group names.
+if ($^O =~ /^(?:uwin|solaris)$/) {
+       # Or anybody else who can have spaces in group names.
        $gr1 = join(' ', grep(!$did{$_}++, sort split(' ', join(' ', @gr))));
 } else {
        $gr1 = join(' ', sort @gr);