Integrate mainline (mostly) utf8.c does not compile.
[p5sagit/p5-mst-13.2.git] / lib / Net / t / netrc.t
index e87388f..885b515 100644 (file)
@@ -5,6 +5,9 @@ BEGIN {
        chdir 't' if -d 't';
        @INC = '../lib';
     }
+    if (!eval "require Socket") {
+       print "1..0 # no Socket\n"; exit 0;
+    }
     if (ord('A') == 193 && !eval "require Convert::EBCDIC") {
         print "1..0 # EBCDIC but no Convert::EBCDIC\n"; exit 0;
     }
@@ -55,13 +58,18 @@ SKIP: {
        $stat[2] = 077;
        ok( !defined(Net::Netrc::_readrc()),
                '_readrc() should not read world-writable file' );
-       ok( $warn =~ /^Bad permissions/, '... and should warn about it' );
+       ok( $warn =~ /^Bad permissions:/, '... and should warn about it' );
 
        # the owner field should still not match
        $stat[2] = 0;
-       ok( !defined(Net::Netrc::_readrc()),
-               '_readrc() should not read file owned by someone else' );
-       ok( $warn =~ /^Not owner/, '... and should warn about it' );
+
+        if ($<) { 
+          ok( !defined(Net::Netrc::_readrc()), 
+              '_readrc() should not read file owned by someone else' ); 
+          ok( $warn =~ /^Not owner:/, '... and should warn about it' ); 
+        } else { 
+          ok(1, "Skip - testing as root") for 1..2; 
+        } 
 }
 
 # this field must now match, to avoid the last-tested warning