From 4ae14b130afa39ca9d395d34b0a758f6d4af43cd Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Tue, 12 Jan 2021 23:09:21 -0500 Subject: Tidy import statements --- t/abs.t | 2 +- t/clone.t | 2 +- t/data.t | 2 +- t/escape-char.t | 2 +- t/escape.t | 8 +------- t/ftp.t | 2 +- t/generic.t | 2 +- t/gopher.t | 2 +- t/heuristic.t | 4 ++-- t/http.t | 2 +- t/iri.t | 4 ++-- t/ldap.t | 2 +- t/mailto.t | 2 +- t/mix.t | 4 ++-- t/mms.t | 2 +- t/news.t | 2 +- t/num_eq.t | 2 +- t/old-base.t | 2 +- t/old-relbase.t | 2 +- t/pop.t | 2 +- t/punycode.t | 2 +- t/query-param.t | 2 +- t/rel.t | 2 +- t/rfc2732.t | 2 +- t/roy-test.t | 4 ++-- t/rsync.t | 2 +- t/rtsp.t | 2 +- t/scheme-exceptions.t | 2 +- t/sip.t | 2 +- t/sort-hash-query-form.t | 2 +- t/split.t | 2 +- t/urn-isbn.t | 2 +- t/urn-oid.t | 2 +- t/utf8.t | 4 ++-- 34 files changed, 39 insertions(+), 45 deletions(-) (limited to 't') diff --git a/t/abs.t b/t/abs.t index cf74ef4..fc5676e 100644 --- a/t/abs.t +++ b/t/abs.t @@ -6,7 +6,7 @@ print "1..45\n"; # This test the resolution of abs path for all examples given # in the "Uniform Resource Identifiers (URI): Generic Syntax" document. -use URI; +use URI (); my $base = "http://a/b/c/d;p?q"; my $testno = 1; my @rel_fail; diff --git a/t/clone.t b/t/clone.t index 57201f5..6eb15eb 100644 --- a/t/clone.t +++ b/t/clone.t @@ -3,7 +3,7 @@ use warnings; print "1..2\n"; -use URI::URL; +use URI::URL (); my $b = URI::URL->new("http://www/"); diff --git a/t/data.t b/t/data.t index 31890ea..c67c8bf 100644 --- a/t/data.t +++ b/t/data.t @@ -3,7 +3,7 @@ use warnings; print "1..22\n"; -use URI; +use URI (); my $u = URI->new("data:,A%20brief%20note"); print "not " unless $u->scheme eq "data" && $u->opaque eq ",A%20brief%20note"; diff --git a/t/escape-char.t b/t/escape-char.t index b03e43d..c6ce79c 100644 --- a/t/escape-char.t +++ b/t/escape-char.t @@ -4,7 +4,7 @@ use warnings; # see https://rt.cpan.org/Ticket/Display.html?id=96941 use Test::More; -use URI; +use URI (); TODO: { my $str = "http://foo/\xE9"; diff --git a/t/escape.t b/t/escape.t index 05b8022..689277b 100644 --- a/t/escape.t +++ b/t/escape.t @@ -3,7 +3,7 @@ use warnings; use Test::More tests => 12; -use URI::Escape; +use URI::Escape qw(%escapes uri_escape uri_escape_utf8 uri_unescape); is uri_escape("|abcå"), "%7Cabc%E5"; @@ -19,14 +19,8 @@ is uri_unescape("%7Cabc%e5"), "|abc is_deeply [uri_unescape("%40A%42", "CDE", "F%47H")], [qw(@AB CDE FGH)]; - -use URI::Escape qw(%escapes); - is $escapes{"%"}, "%25"; - -use URI::Escape qw(uri_escape_utf8); - is uri_escape_utf8("|abcå"), "%7Cabc%C3%A5"; skip "Perl 5.8.0 or higher required", 3 if $] < 5.008; diff --git a/t/ftp.t b/t/ftp.t index 9340885..c8a2c52 100644 --- a/t/ftp.t +++ b/t/ftp.t @@ -3,7 +3,7 @@ use warnings; print "1..13\n"; -use URI; +use URI (); my $uri; $uri = URI->new("ftp://ftp.example.com/path"); diff --git a/t/generic.t b/t/generic.t index e2f7b97..4885ced 100644 --- a/t/generic.t +++ b/t/generic.t @@ -3,7 +3,7 @@ use warnings; print "1..48\n"; -use URI; +use URI (); my $foo = URI->new("Foo:opaque#frag"); diff --git a/t/gopher.t b/t/gopher.t index 427a5fc..8697eac 100644 --- a/t/gopher.t +++ b/t/gopher.t @@ -3,7 +3,7 @@ use warnings; print "1..48\n"; -use URI; +use URI (); my $t = 1; sub is { diff --git a/t/heuristic.t b/t/heuristic.t index 63c2ad8..e64c338 100644 --- a/t/heuristic.t +++ b/t/heuristic.t @@ -15,7 +15,7 @@ BEGIN { print "1..26\n"; -use URI::Heuristic qw(uf_urlstr uf_url); +use URI::Heuristic qw(uf_url uf_urlstr); if (shift) { $URI::Heuristic::DEBUG++; open(STDERR, ">&STDOUT"); # redirect STDERR @@ -59,7 +59,7 @@ print "ok 5\n"; print "not " unless uf_urlstr("perl/camel.gif") =~ m,^http://www\.perl\.(org|co)\.uk/camel\.gif$,; print "ok 6\n"; - use Net::Domain; + use Net::Domain (); $ENV{LC_ALL} = "C"; { no warnings; *Net::Domain::hostfqdn = sub { return 'vasya.su' } } undef $URI::Heuristic::MY_COUNTRY; diff --git a/t/http.t b/t/http.t index fb30124..1e00101 100644 --- a/t/http.t +++ b/t/http.t @@ -3,7 +3,7 @@ use warnings; print "1..16\n"; -use URI; +use URI (); my $u = URI->new(""); diff --git a/t/iri.t b/t/iri.t index f1dfd51..47600ab 100644 --- a/t/iri.t +++ b/t/iri.t @@ -3,7 +3,7 @@ use warnings; use utf8; use Test::More; -use Config; +use Config qw(%Config); if (defined $Config{useperlio}) { plan tests=>26; @@ -11,7 +11,7 @@ if (defined $Config{useperlio}) { plan skip_all=>'this perl doesn\'t support PerlIO layers'; } -use URI; +use URI (); use URI::IRI; my $u; diff --git a/t/ldap.t b/t/ldap.t index 3cd3dd8..3c45626 100644 --- a/t/ldap.t +++ b/t/ldap.t @@ -3,7 +3,7 @@ use warnings; print "1..24\n"; -use URI; +use URI (); my $uri; diff --git a/t/mailto.t b/t/mailto.t index f13a1f8..d086e93 100644 --- a/t/mailto.t +++ b/t/mailto.t @@ -3,7 +3,7 @@ use warnings; print "1..7\n"; -use URI; +use URI (); my $u = URI->new('mailto:gisle@aas.no'); diff --git a/t/mix.t b/t/mix.t index b72942a..71772dd 100644 --- a/t/mix.t +++ b/t/mix.t @@ -4,9 +4,9 @@ use warnings; print "1..6\n"; # Test mixing of URI and URI::WithBase objects -use URI; +use URI (); use URI::WithBase; -use URI::URL; +use URI::URL (); my $str = "http://www.sn.no/"; my $rel = "path/img.gif"; diff --git a/t/mms.t b/t/mms.t index d3ac1d1..18d35a7 100644 --- a/t/mms.t +++ b/t/mms.t @@ -3,7 +3,7 @@ use warnings; print "1..8\n"; -use URI; +use URI (); my $u = URI->new(""); diff --git a/t/news.t b/t/news.t index a009a9e..947697f 100644 --- a/t/news.t +++ b/t/news.t @@ -3,7 +3,7 @@ use warnings; print "1..7\n"; -use URI; +use URI (); my $u = URI->new("news:comp.lang.perl.misc"); diff --git a/t/num_eq.t b/t/num_eq.t index 066d84c..257a5fa 100644 --- a/t/num_eq.t +++ b/t/num_eq.t @@ -5,7 +5,7 @@ use strict; use warnings; use Test::More 'no_plan'; -use URI; +use URI (); my $uri1 = URI->new("http://foo.com"); my $uri2 = URI->new("http://foo.com"); diff --git a/t/old-base.t b/t/old-base.t index 984aab1..706051a 100644 --- a/t/old-base.t +++ b/t/old-base.t @@ -4,7 +4,7 @@ use warnings; use Test::More 0.96; use URI::URL qw(url); use URI::Escape qw(uri_escape uri_unescape); -use File::Temp 'tempdir'; +use File::Temp qw(tempdir); # want compatibility use URI::file; diff --git a/t/old-relbase.t b/t/old-relbase.t index 3bd0ae8..ae76a1d 100644 --- a/t/old-relbase.t +++ b/t/old-relbase.t @@ -3,7 +3,7 @@ use warnings; print "1..5\n"; -use URI::URL; +use URI::URL qw(url); # We used to have problems with URLs that used a base that was # not absolute itself. diff --git a/t/pop.t b/t/pop.t index 4519484..1c4709c 100644 --- a/t/pop.t +++ b/t/pop.t @@ -3,7 +3,7 @@ use warnings; print "1..8\n"; -use URI; +use URI (); my $u = URI->new('pop://aas@pop.sn.no'); diff --git a/t/punycode.t b/t/punycode.t index d1e3084..36d8e96 100644 --- a/t/punycode.t +++ b/t/punycode.t @@ -3,7 +3,7 @@ use warnings; use utf8; use Test::More tests => 15; -use URI::_punycode qw(encode_punycode decode_punycode); +use URI::_punycode qw(decode_punycode encode_punycode); my %RFC_3492 = ( A => { diff --git a/t/query-param.t b/t/query-param.t index fc852c0..473b290 100644 --- a/t/query-param.t +++ b/t/query-param.t @@ -3,7 +3,7 @@ use warnings; use Test::More tests => 19; -use URI; +use URI (); use URI::QueryParam; my $u = URI->new("http://www.sol.no?foo=4&bar=5&foo=5"); diff --git a/t/rel.t b/t/rel.t index 104ae5d..32d66e6 100644 --- a/t/rel.t +++ b/t/rel.t @@ -5,7 +5,7 @@ use Test::More; plan tests => 6; -use URI; +use URI (); my $uri; diff --git a/t/rfc2732.t b/t/rfc2732.t index d69960a..2b0fa5b 100644 --- a/t/rfc2732.t +++ b/t/rfc2732.t @@ -5,7 +5,7 @@ use warnings; use Test::More tests => 19; -use URI; +use URI (); my $uri = URI->new("http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html"); is $uri->as_string, "http://[FEDC:BA98:7654:3210:FEDC:BA98:7654:3210]:80/index.html"; diff --git a/t/roy-test.t b/t/roy-test.t index a7a9fdc..db06c26 100644 --- a/t/roy-test.t +++ b/t/roy-test.t @@ -1,10 +1,10 @@ use strict; use warnings; -use Test qw(plan ok); +use Test qw(ok plan); plan tests => 102; -use URI; +use URI (); use File::Spec::Functions qw(catfile); my $no = 1; diff --git a/t/rsync.t b/t/rsync.t index 01e91d7..5a65aae 100644 --- a/t/rsync.t +++ b/t/rsync.t @@ -3,7 +3,7 @@ use warnings; print "1..4\n"; -use URI; +use URI (); my $u = URI->new('rsync://gisle@perl.com/foo/bar'); diff --git a/t/rtsp.t b/t/rtsp.t index 208b63b..af08064 100644 --- a/t/rtsp.t +++ b/t/rtsp.t @@ -3,7 +3,7 @@ use warnings; print "1..9\n"; -use URI; +use URI (); my $u = URI->new(""); diff --git a/t/scheme-exceptions.t b/t/scheme-exceptions.t index 82740be..e1cb568 100644 --- a/t/scheme-exceptions.t +++ b/t/scheme-exceptions.t @@ -2,7 +2,7 @@ use strict; use warnings; use Test::More; -use URI; +use URI (); plan skip_all => 'this test assumes that URI::javascript does not exist' if eval { +require URI::javascript }; diff --git a/t/sip.t b/t/sip.t index 506bba3..4a069ff 100644 --- a/t/sip.t +++ b/t/sip.t @@ -3,7 +3,7 @@ use warnings; print "1..11\n"; -use URI; +use URI (); my $u = URI->new('sip:phone@domain.ext'); print "not " unless $u->user eq 'phone' && diff --git a/t/sort-hash-query-form.t b/t/sort-hash-query-form.t index 7c6f896..b79a4b7 100644 --- a/t/sort-hash-query-form.t +++ b/t/sort-hash-query-form.t @@ -5,7 +5,7 @@ use Test::More; # ABSTRACT: Make sure query_form(\%hash) is sorted -use URI; +use URI (); my $base = URI->new('http://example.org/'); diff --git a/t/split.t b/t/split.t index 34104b8..58c3c5f 100644 --- a/t/split.t +++ b/t/split.t @@ -3,7 +3,7 @@ use warnings; print "1..17\n"; -use URI::Split qw(uri_split uri_join); +use URI::Split qw(uri_join uri_split); sub j { join("-", map { defined($_) ? $_ : "" } @_) } diff --git a/t/urn-isbn.t b/t/urn-isbn.t index f512bde..18136ef 100644 --- a/t/urn-isbn.t +++ b/t/urn-isbn.t @@ -5,7 +5,7 @@ use Test::Needs 'Business::ISBN'; print "1..13\n"; -use URI; +use URI (); my $u = URI->new("URN:ISBN:0395363411"); print "not " unless $u eq "URN:ISBN:0395363411" && diff --git a/t/urn-oid.t b/t/urn-oid.t index d35e524..8298749 100644 --- a/t/urn-oid.t +++ b/t/urn-oid.t @@ -3,7 +3,7 @@ use warnings; print "1..4\n"; -use URI; +use URI (); my $u = URI->new("urn:oid"); diff --git a/t/utf8.t b/t/utf8.t index 1453cfc..1e26864 100644 --- a/t/utf8.t +++ b/t/utf8.t @@ -4,7 +4,7 @@ use warnings; use utf8; use Test::More 'no_plan'; -use URI; +use URI (); is(URI->new('http://foobar/mooi€e')->as_string, 'http://foobar/mooi%E2%82%ACe'); @@ -14,7 +14,7 @@ is( $uri->query, "mooi%E2%82%ACe=mooi%E2%82%ACe" ); is( ($uri->query_form)[1], "mooi\xE2\x82\xACe" ); # RT#70161 -use Encode; +use Encode qw(decode_utf8); $uri = URI->new(decode_utf8 '?Query=%C3%A4%C3%B6%C3%BC'); is( ($uri->query_form)[1], "\xC3\xA4\xC3\xB6\xC3\xBC"); is( decode_utf8(($uri->query_form)[1]), 'äöü'); -- cgit v1.2.1