Integrate mainline
[p5sagit/p5-mst-13.2.git] / lib / Net / Ping / t / 120_udp_inst.t
index ee53bd4..f7b77b1 100644 (file)
@@ -1,6 +1,17 @@
 # Test to make sure object can be instantiated for udp protocol.
 # I do not know of any servers that support udp echo anymore.
 
+BEGIN {
+  unless (eval "require Socket") {
+    print "1..0 \# Skip: no Socket\n";
+    exit;
+  }
+  unless (getservbyname('echo', 'udp')) {
+    print "1..0 \# Skip: no echo port\n";
+    exit;
+  }
+}
+
 use Test;
 use Net::Ping;
 plan tests => 2;