In OS/390 'localhost' can be 'localhost.FOO.BAR'.
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 30 Nov 2000 16:04:49 +0000 (16:04 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 30 Nov 2000 16:04:49 +0000 (16:04 +0000)
p4raw-id: //depot/perl@7934

t/lib/net-hostent.t

index 4a5df80..f80de24 100644 (file)
@@ -31,13 +31,14 @@ print "ok 3\n";
 # 127.0.0.1 or even "localhost"
 
 # VMS returns "LOCALHOST" under tcp/ip services V4.1 ECO 2, possibly others
+# OS/390 returns localhost.YADDA.YADDA
 
 if ($^O eq 'MSWin32') {
   print "ok $_ # skipped on win32\n" for (4,5);
 } else {
-  print "not " if $h->name !~ /localhost/i;
+  print "not " unless $h->name =~ /^localhost(?:\..+)?$/i;
   print "ok 4 # ",$h->name,"\n";
 
-  print "not " if $i->name !~ /localhost/i;
+  print "not " unless $i->name =~ /^localhost(?:\..+)?$/i;
   print "ok 5 # ",$i->name,"\n";
 }