r63453 - in /trunk/liburi-perl: Changes META.yml URI.pm debian/changelog t/heuristic.t

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Thu Oct 7 02:19:34 UTC 2010


Author: jawnsy-guest
Date: Thu Oct  7 02:19:25 2010
New Revision: 63453

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=63453
Log:
No longer depends on DNS for tests... Not sure if this is worth
an upload
* New upstream release

Modified:
    trunk/liburi-perl/Changes
    trunk/liburi-perl/META.yml
    trunk/liburi-perl/URI.pm
    trunk/liburi-perl/debian/changelog
    trunk/liburi-perl/t/heuristic.t

Modified: trunk/liburi-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/Changes?rev=63453&op=diff
==============================================================================
--- trunk/liburi-perl/Changes (original)
+++ trunk/liburi-perl/Changes Thu Oct  7 02:19:25 2010
@@ -1,3 +1,11 @@
+2010-10-06   Gisle Aas <gisle at ActiveState.com>
+
+   Release 1.56
+
+   Don't depend on DNS for the heuristics test
+
+
+
 2010-09-01   Gisle Aas <gisle at ActiveState.com>
 
    Release 1.55

Modified: trunk/liburi-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/META.yml?rev=63453&op=diff
==============================================================================
--- trunk/liburi-perl/META.yml (original)
+++ trunk/liburi-perl/META.yml Thu Oct  7 02:19:25 2010
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:               URI
-version:            1.55
+version:            1.56
 abstract:           Uniform Resource Identifiers (absolute and relative)
 author:
     - Gisle Aas <gisle at activestate.com>

Modified: trunk/liburi-perl/URI.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/URI.pm?rev=63453&op=diff
==============================================================================
--- trunk/liburi-perl/URI.pm (original)
+++ trunk/liburi-perl/URI.pm Thu Oct  7 02:19:25 2010
@@ -2,7 +2,7 @@
 
 use strict;
 use vars qw($VERSION);
-$VERSION = "1.55";
+$VERSION = "1.56";
 
 use vars qw($ABS_REMOTE_LEADING_DOTS $ABS_ALLOW_RELATIVE_SCHEME $DEFAULT_QUERY_FORM_DELIMITER);
 

Modified: trunk/liburi-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/debian/changelog?rev=63453&op=diff
==============================================================================
--- trunk/liburi-perl/debian/changelog (original)
+++ trunk/liburi-perl/debian/changelog Thu Oct  7 02:19:25 2010
@@ -1,3 +1,12 @@
+liburi-perl (1.56-1) UNRELEASED; urgency=low
+
+  No longer depends on DNS for tests... Not sure if this is worth
+  an upload
+
+  * New upstream release
+
+ -- Jonathan Yu <jawnsy at cpan.org>  Wed, 06 Oct 2010 22:29:36 -0400
+
 liburi-perl (1.55-1) unstable; urgency=low
 
   * New upstream release

Modified: trunk/liburi-perl/t/heuristic.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/liburi-perl/t/heuristic.t?rev=63453&op=diff
==============================================================================
--- trunk/liburi-perl/t/heuristic.t (original)
+++ trunk/liburi-perl/t/heuristic.t Thu Oct  7 02:19:25 2010
@@ -1,8 +1,15 @@
 #!perl -w
 
-if (-f "OFFLINE") {
-   print "1..0";
-   exit;
+BEGIN {
+    # mock up a gethostbyname that always works :-)
+    *CORE::GLOBAL::gethostbyname = sub {
+	my $name = shift;
+	#print "# gethostbyname [$name]\n";
+	die if wantarray;
+	return 1 if $name =~ /^www\.perl\.(com|org|ca|su)\.$/;
+	return 1 if $name eq "www.perl.co.uk\.";
+	return 0;
+    };
 }
 
 print "1..20\n";
@@ -41,90 +48,72 @@
 }
 print "ok 5\n";
 
-if (gethostbyname("www.perl.com") && gethostbyname("www.perl.co.uk") && !gethostbyname("www.perl.bv")) {
-    # DNS works, let's run tests 6..12
+{
+    local $ENV{LC_ALL} = "";
+    local $ENV{LANG} = "";
+    local $ENV{HTTP_ACCEPT_LANGUAGE} = "";
 
-    {
-        local $ENV{LC_ALL} = "";
-        local $ENV{LANG} = "";
-        local $ENV{HTTP_ACCEPT_LANGUAGE} = "";
+    $ENV{LC_ALL} = "en_GB.UTF-8";
+    undef $URI::Heuristic::MY_COUNTRY;
+    print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.(org|co)\.uk/camel\.gif$,;
+    print "ok 6\n";
 
-        $ENV{LC_ALL} = "en_GB.UTF-8";
-        undef $URI::Heuristic::MY_COUNTRY;
-        print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.(org|co)\.uk/camel\.gif$,;
-        print "ok 6\n";
+    use Net::Domain;
+    $ENV{LC_ALL} = "C";
+    { no warnings; *Net::Domain::hostfqdn = sub { return 'vasya.su' } }
+    undef $URI::Heuristic::MY_COUNTRY;
+    print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.su/camel\.gif$,;
+    print "ok 7\n";
 
-        use Net::Domain;
-        $ENV{LC_ALL} = "C";
-        { no warnings; *Net::Domain::hostfqdn = sub { return 'vasya.su' } }
-        undef $URI::Heuristic::MY_COUNTRY;
-        print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.su/camel\.gif$,;
-        print "ok 7\n";
+    $ENV{LC_ALL} = "C";
+    { no warnings; *Net::Domain::hostfqdn = sub { return '' } }
+    undef $URI::Heuristic::MY_COUNTRY;
+    print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.(com|org)/camel\.gif$,;
+    print "ok 8\n";
 
-        $ENV{LC_ALL} = "C";
-        { no warnings; *Net::Domain::hostfqdn = sub { return '' } }
-        undef $URI::Heuristic::MY_COUNTRY;
-        print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.(com|org)/camel\.gif$,;
-        print "ok 8\n";
-
-        $ENV{HTTP_ACCEPT_LANGUAGE} = "en-ca";
-        undef $URI::Heuristic::MY_COUNTRY;
-        print "not " unless uf_urlstr("perl/camel.gif") eq "http://www.perl.ca/camel.gif";
-        print "ok 9\n";
-    }
-
-    $URI::Heuristic::MY_COUNTRY = "bv";
-    print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.(com|org)/camel\.gif$,;
-    print "ok 10\n";
-
-    # Backwards compatibility; uk != United Kingdom in ISO 3166
-    $URI::Heuristic::MY_COUNTRY = "uk";
-    print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.(org|co)\.uk/camel\.gif$,;
-    print "ok 11\n";
-
-    $URI::Heuristic::MY_COUNTRY = "gb";
-    print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.(org|co)\.uk/camel\.gif$,;
-    print "ok 12\n";
-
-    $ENV{URL_GUESS_PATTERN} = "www.ACME.org www.ACME.com";
-    print "not " unless uf_urlstr("perl") eq "http://www.perl.org";
-    print "ok 13\n";
-
-} else {
-    # don't make the innocent worry
-    print "Skipping test 6-12 because DNS does not work\n";
-    for (6..13) { print "ok $_\n"; }
-
+    $ENV{HTTP_ACCEPT_LANGUAGE} = "en-ca";
+    undef $URI::Heuristic::MY_COUNTRY;
+    print "not " unless uf_urlstr("perl/camel.gif") eq "http://www.perl.ca/camel.gif";
+    print "ok 9\n";
 }
 
+$URI::Heuristic::MY_COUNTRY = "bv";
+print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.(com|org)/camel\.gif$,;
+print "ok 10\n";
+
+# Backwards compatibility; uk != United Kingdom in ISO 3166
+$URI::Heuristic::MY_COUNTRY = "uk";
+print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.(org|co)\.uk/camel\.gif$,;
+print "ok 11\n";
+
+$URI::Heuristic::MY_COUNTRY = "gb";
+print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.(org|co)\.uk/camel\.gif$,;
+print "ok 12\n";
+
+$ENV{URL_GUESS_PATTERN} = "www.ACME.org www.ACME.com";
+print "not " unless uf_urlstr("perl") eq "http://www.perl.org";
+print "ok 13\n";
+
 {
-local $ENV{URL_GUESS_PATTERN} = "";
-print "not " unless uf_urlstr("perl") eq "http://perl";
-print "ok 14\n";
+    local $ENV{URL_GUESS_PATTERN} = "";
+    print "not " unless uf_urlstr("perl") eq "http://perl";
+    print "ok 14\n";
 
-print "not " unless uf_urlstr("http:80") eq "http:80";
-print "ok 15\n";
+    print "not " unless uf_urlstr("http:80") eq "http:80";
+    print "ok 15\n";
 
-print "not " unless uf_urlstr("mailto:gisle\@aas.no") eq "mailto:gisle\@aas.no";
-print "ok 16\n";
+    print "not " unless uf_urlstr("mailto:gisle\@aas.no") eq "mailto:gisle\@aas.no";
+    print "ok 16\n";
 
-print "not " unless uf_urlstr("gisle\@aas.no") eq "mailto:gisle\@aas.no";
-print "ok 17\n";
+    print "not " unless uf_urlstr("gisle\@aas.no") eq "mailto:gisle\@aas.no";
+    print "ok 17\n";
 
-print "not " unless uf_urlstr("Gisle.Aas\@aas.perl.org") eq "mailto:Gisle.Aas\@aas.perl.org";
-print "ok 18\n";
+    print "not " unless uf_urlstr("Gisle.Aas\@aas.perl.org") eq "mailto:Gisle.Aas\@aas.perl.org";
+    print "ok 18\n";
 
-print "not " unless uf_url("gopher.sn.no")->scheme eq "gopher";
-print "ok 19\n";
+    print "not " unless uf_url("gopher.sn.no")->scheme eq "gopher";
+    print "ok 19\n";
 
-print "not " unless uf_urlstr("123.3.3.3:8080/foo") eq "http://123.3.3.3:8080/foo";
-print "ok 20\n";
+    print "not " unless uf_urlstr("123.3.3.3:8080/foo") eq "http://123.3.3.3:8080/foo";
+    print "ok 20\n";
 }
-
-#
-#print "not " unless uf_urlstr("some-site") eq "http://www.some-site.com";
-#print "ok 15\n";
-#
-#print "not " unless uf_urlstr("some-site.com") eq "http://some-site.com";
-#print "ok 16\n";
-#




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