summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/dist/Net-Ping/t/130_tcp_inst.t
blob: 21f01817539d38f4ee891214fd32251e0c2d6785 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Test to make sure object can be instantiated for tcp protocol.

use strict;
use Config;

BEGIN {
  unless (eval "require Socket") {
    print "1..0 \# Skip: no Socket\n";
    exit;
  }
  unless (getservbyname('echo', 'tcp')) {
    print "1..0 \# Skip: no echo port\n";
    exit;
  }
  unless ($Config{d_getpbyname}) {
    print "1..0 \# Skip: no getprotobyname\n";
    exit;
  }
}

use Test::More tests => 2;
BEGIN {use_ok 'Net::Ping'};

my $p = new Net::Ping "tcp";
isa_ok($p, 'Net::Ping', 'object can be instantiated for tcp protocol');