r63700 - in /trunk/libnetaddr-ip-perl/Lite: README t/v4-wnew.t

periapt-guest at users.alioth.debian.org periapt-guest at users.alioth.debian.org
Thu Oct 14 13:44:10 UTC 2010


Author: periapt-guest
Date: Thu Oct 14 13:43:55 2010
New Revision: 63700

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=63700
Log:
resyncing files with uptream

Added:
    trunk/libnetaddr-ip-perl/Lite/t/v4-wnew.t
Modified:
    trunk/libnetaddr-ip-perl/Lite/README

Modified: trunk/libnetaddr-ip-perl/Lite/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetaddr-ip-perl/Lite/README?rev=63700&op=diff
==============================================================================
--- trunk/libnetaddr-ip-perl/Lite/README (original)
+++ trunk/libnetaddr-ip-perl/Lite/README Thu Oct 14 13:43:55 2010
@@ -63,6 +63,7 @@
     The supported operations are described below:
 
   Overloaded Operators
+
     Assignment ("=")
         Has been optimized to copy one NetAddr::IP::Lite object to another
         very quickly.
@@ -70,7 +71,8 @@
     "->copy()"
         The assignment ("=") operation is only put in to operation when the
         copied object is further mutated by another overloaded operation.
-        See overload SPECIAL SYMBOLS FOR "use overload" for details.
+        See the overload manpage SPECIAL SYMBOLS FOR "use overload" for
+        details.
 
         "->copy()" actually creates a new object when called.
 
@@ -86,7 +88,7 @@
                 my $ip = new6 NetAddr::IP::Lite '192.168.1.123';
                 print "$ip\n";
 
-        Will print the string 0:0:0:0:0:0:C0A8:17B/128
+        Will print the string
 
     Equality
         You can test for equality with either "eq", "ne", "==" or "!=".
@@ -158,13 +160,14 @@
         opposite of auto-incrementing it, as you would expect.
 
   Methods
+
     "->new([$addr, [ $mask|IPv6 ]])"
     "->new6([$addr, [ $mask]])"
     "->new_no([$addr, [ $mask]])"
     "->new_from_aton($netaddr)"
         The first two methods create a new address with the supplied address
-        in $addr and an optional netmask $mask, which can be omitted to get
-        a /32 or /128 netmask for IPv4 / IPv6 addresses respectively.
+        in "$addr" and an optional netmask "$mask", which can be omitted to
+        get a /32 or /128 netmask for IPv4 / IPv6 addresses respectively.
 
         The third method "new_no" is exclusively for IPv4 addresses and
         filters improperly formatted dot quad strings for leading 0's that
@@ -187,7 +190,7 @@
 
           See "STRINGIFICATION" below.
 
-        $addr can be almost anything that can be resolved to an IP address
+        "$addr" can be almost anything that can be resolved to an IP address
         in all the notations I have seen over time. It can optionally
         contain the mask in CIDR notation. If the OPTIONAL perl module
         Socket6 is available in the local library it will autoload and ipV6
@@ -210,7 +213,7 @@
 
         If called with no arguments, 'default' is assumed.
 
-        $addr can be any of the following and possibly more...
+        "$addr" can be any of the following and possibly more...
 
           n.n
           n.n/mm
@@ -304,14 +307,14 @@
         subnet.
 
     "$me->contains($other)"
-        Returns true when $me completely contains $other. False is returned
-        otherwise and "undef" is returned if $me and $other are not both
-        "NetAddr::IP::Lite" objects.
+        Returns true when "$me" completely contains "$other". False is
+        returned otherwise and "undef" is returned if "$me" and "$other" are
+        not both "NetAddr::IP::Lite" objects.
 
     "$me->within($other)"
-        The complement of "->contains()". Returns true when $me is
-        completely contained within $other, undef if $me and $other are not
-        both "NetAddr::IP::Lite" objects.
+        The complement of "->contains()". Returns true when "$me" is
+        completely contained within "$other", undef if "$me" and "$other"
+        are not both "NetAddr::IP::Lite" objects.
 
     "->first()"
         Returns a new object representing the first usable IP address within
@@ -324,7 +327,7 @@
     "->nth($index)"
         Returns a new object representing the *n*-th usable IP address
         within the subnet (ie, the *n*-th host address). If no address is
-        available (for example, when the network is too small for $index
+        available (for example, when the network is too small for "$index"
         hosts), "undef" is returned.
 
         Version 4.00 of NetAddr::IP and version 1.00 of NetAddr::IP::Lite

Added: trunk/libnetaddr-ip-perl/Lite/t/v4-wnew.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libnetaddr-ip-perl/Lite/t/v4-wnew.t?rev=63700&op=file
==============================================================================
--- trunk/libnetaddr-ip-perl/Lite/t/v4-wnew.t (added)
+++ trunk/libnetaddr-ip-perl/Lite/t/v4-wnew.t Thu Oct 14 13:43:55 2010
@@ -1,0 +1,23 @@
+use Test::More tests => 12;
+use NetAddr::IP::Lite;
+
+my @good = (qw(default any broadcast loopback));
+my @bad = map { ("$_.neveranydomainlikethis.in-addr.arpa",
+		 "nohostlikethis.${_}.in-addr.arpa") } @good;
+
+my $bad = scalar @bad;
+
+diag <<EOF;
+
+\tThe following $bad tests involve resolving (hopefully)
+\tnon-existant names. This may take a while.
+EOF
+
+SKIP: {
+	skip "defective or missing resolver", 12,
+		if defined NetAddr::IP::Lite->new('not.defined.in-addr.arpa');
+	ok(!defined NetAddr::IP::Lite->new($_), "not defined ->new($_)")
+	    for @bad;
+	ok(defined NetAddr::IP::Lite->new($_), "defined ->new($_)")
+	    for @good;
+};




More information about the Pkg-perl-cvs-commits mailing list