summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2000-12-02 14:28:27 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-02 18:06:20 +0000
commit67b60da2c3bee81aee331f3b6e0396a4b810e365 (patch)
tree45e6a8047dfb16df88439ba9a9cf29b41e586479 /t
parentdcd7796ab9330335475a23f3bb99758a7fe5b8d4 (diff)
downloadperl-67b60da2c3bee81aee331f3b6e0396a4b810e365.tar.gz
Re: [ID 20001202.001] (Net::hostent)
Message-ID: <20001202142827.A12308@plum.flirble.org> Test robustness. p4raw-id: //depot/perl@7956
Diffstat (limited to 't')
-rw-r--r--t/lib/net-hostent.t22
1 files changed, 15 insertions, 7 deletions
diff --git a/t/lib/net-hostent.t b/t/lib/net-hostent.t
index f80de24810..6e22921cd4 100644
--- a/t/lib/net-hostent.t
+++ b/t/lib/net-hostent.t
@@ -1,8 +1,14 @@
#!./perl -w
BEGIN {
- chdir 't' if -d 't';
- @INC = '../lib';
+ chdir 't' if -d 't';
+ @INC = '../lib';
+ require Config; import Config;
+ if ($Config{'extensions'} !~ /\bSocket\b/ &&
+ !(($^O eq 'VMS') && $Config{d_socket})) {
+ print "1..0 # Test uses Socket, Socket not built\n";
+ exit 0;
+ }
}
BEGIN { $| = 1; print "1..5\n"; }
@@ -18,13 +24,15 @@ print "ok 1\n";
use Socket;
my $h = gethost('localhost');
+print +(defined $h ? '' : 'not ') . "ok 2\n";
my $i = gethostbyaddr(inet_aton("127.0.0.1"));
+print +(!defined $i ? 'not ' : '') . "ok 3\n";
print "not " if inet_ntoa($h->addr) ne "127.0.0.1";
-print "ok 2\n";
+print "ok 4\n";
print "not " if inet_ntoa($i->addr) ne "127.0.0.1";
-print "ok 3\n";
+print "ok 5\n";
# need to skip the name comparisons on Win32 because windows will
# return the name of the machine instead of "localhost" when resolving
@@ -34,11 +42,11 @@ print "ok 3\n";
# OS/390 returns localhost.YADDA.YADDA
if ($^O eq 'MSWin32') {
- print "ok $_ # skipped on win32\n" for (4,5);
+ print "ok $_ # skipped on win32\n" for (6,7);
} else {
print "not " unless $h->name =~ /^localhost(?:\..+)?$/i;
- print "ok 4 # ",$h->name,"\n";
+ print "ok 6 # ",$h->name,"\n";
print "not " unless $i->name =~ /^localhost(?:\..+)?$/i;
- print "ok 5 # ",$i->name,"\n";
+ print "ok 7 # ",$i->name,"\n";
}