8 BEGIN { $| = 1; print "1..5\n"; }
10 END {print "not ok 1\n" unless $loaded;}
17 # test basic resolution of localhost <-> 127.0.0.1
20 my $h = gethost('localhost');
21 my $i = gethostbyaddr(inet_aton("127.0.0.1"));
23 print "not " if inet_ntoa($h->addr) ne "127.0.0.1";
26 print "not " if inet_ntoa($i->addr) ne "127.0.0.1";
29 # need to skip the name comparisons on Win32 because windows will
30 # return the name of the machine instead of "localhost" when resolving
31 # 127.0.0.1 or even "localhost"
33 # VMS returns "LOCALHOST" under tcp/ip services V4.1 ECO 2, possibly others
34 # OS/390 returns localhost.YADDA.YADDA
36 if ($^O eq 'MSWin32') {
37 print "ok $_ # skipped on win32\n" for (4,5);
39 print "not " unless $h->name =~ /^localhost(?:\..+)?$/i;
40 print "ok 4 # ",$h->name,"\n";
42 print "not " unless $i->name =~ /^localhost(?:\..+)?$/i;
43 print "ok 5 # ",$i->name,"\n";