From: Steve Peters Date: Thu, 22 Dec 2005 03:08:59 +0000 (+0000) Subject: Add documentation for method domainname() in Net::Domain. Add some X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c20cde702e4f050369a7a98d262b4e65ac3bed28;p=p5sagit%2Fp5-mst-13.2.git Add documentation for method domainname() in Net::Domain. Add some additional tests for Net::Domain. Also, since it is tested, remove test case from lib/1_compile.t. One step closer to $500. p4raw-id: //depot/perl@26440 --- diff --git a/lib/Net/Domain.pm b/lib/Net/Domain.pm index 40ad2a8..b8b57ab 100644 --- a/lib/Net/Domain.pm +++ b/lib/Net/Domain.pm @@ -16,7 +16,7 @@ use Net::Config; @ISA = qw(Exporter); @EXPORT_OK = qw(hostname hostdomain hostfqdn domainname); -$VERSION = "2.19"; # $Id: //depot/libnet/Net/Domain.pm#21 $ +$VERSION = "2.19_01"; # $Id: //depot/libnet/Net/Domain.pm#21 $ my($host,$domain,$fqdn) = (undef,undef,undef); @@ -299,7 +299,7 @@ Net::Domain - Attempt to evaluate the current host's internet name and domain =head1 SYNOPSIS - use Net::Domain qw(hostname hostfqdn hostdomain); + use Net::Domain qw(hostname hostfqdn hostdomain domainname); =head1 DESCRIPTION @@ -314,6 +314,10 @@ Each of the functions will return I if the FQDN cannot be determined. Identify and return the FQDN of the current host. +=item domainname () + +An alias for hostfqdn (). + =item hostname () Returns the smallest part of the FQDN which can be used to identify the host. diff --git a/lib/Net/t/hostname.t b/lib/Net/t/hostname.t index 9db66a9..7577158 100644 --- a/lib/Net/t/hostname.t +++ b/lib/Net/t/hostname.t @@ -13,7 +13,7 @@ BEGIN { } } -use Net::Domain qw(hostname domainname hostdomain); +use Net::Domain qw(hostname domainname hostdomain hostfqdn); use Net::Config; unless($NetConfig{test_hosts}) { @@ -21,7 +21,7 @@ unless($NetConfig{test_hosts}) { exit 0; } -print "1..2\n"; +print "1..5\n"; $domain = domainname(); @@ -41,3 +41,12 @@ my @dummy = grep { defined hostname() and hostname() eq $_ } @domain; ($domain[0] && $domain[0] eq $copy[0]) ? print "ok 2\n" : print "not ok 2\n"; + +@dummy = grep { defined hostdomain() and hostdomain() eq $_ } @domain; + +($domain[0] && $domain[0] eq $copy[0]) + ? print "ok 3\n" + : print "not ok 3\n"; + +hostfqdn() eq hostname() . "." . hostdomain() ? print "ok 4\n" : print "not ok 4\n"; +domainname() eq hostname() . "." . hostdomain() ? print "ok 5\n" : print "not ok 5\n"; diff --git a/t/lib/1_compile.t b/t/lib/1_compile.t index eb3c3bd..64dad33 100644 --- a/t/lib/1_compile.t +++ b/t/lib/1_compile.t @@ -19,7 +19,6 @@ my @Core_Modules = grep /\S/, ; chomp @Core_Modules; if (eval { require Socket }) { - push @Core_Modules, qw(Net::Domain); # Two Net:: modules need the Convert::EBCDIC if in EBDCIC. if (ord("A") != 193 || eval { require Convert::EBCDIC }) { push @Core_Modules, qw(Net::Cmd Net::POP3);