From c9f5393b917ba7fe24a7e3c97ebbb42496de1466 Mon Sep 17 00:00:00 2001 From: Olaf Alders Date: Sun, 1 Sep 2024 20:32:47 -0400 Subject: [PATCH] perlimports -i t --- t/00_setup.t | 4 +-- t/01_darkpan.t | 6 ++-- t/api/controller/cover.t | 3 +- t/lib/MetaCPAN/DarkPAN.pm | 11 +++--- t/lib/MetaCPAN/Server/Test.pm | 6 ++-- t/lib/MetaCPAN/TestHelpers.pm | 18 +++++----- t/lib/MetaCPAN/TestServer.pm | 35 +++++++++---------- .../Tests/Controller/Search/DownloadURL.pm | 4 +-- t/lib/MetaCPAN/Tests/Model.pm | 2 +- t/lib/MetaCPAN/Tests/Release.pm | 4 +-- t/lib/MetaCPAN/Tests/UserAgent.pm | 6 ++-- t/lib/Module/Faker/Dist/WithPerl.pm | 2 +- t/model/archive.t | 4 +-- t/model/release.t | 3 +- t/model/release/dependencies.t | 5 ++- t/model/release/reverse_dependencies.t | 3 +- t/package.t | 2 +- t/permission.t | 2 +- t/release/bugs.t | 1 - t/release/documentation-hide.t | 2 +- t/release/documentation-not-readme.t | 1 - t/release/file-changes.t | 2 +- t/release/file-duplicates.t | 3 +- t/release/meta-license.t | 1 - t/release/meta-provides.t | 1 - t/release/moose.t | 2 +- t/release/multiple-modules.t | 2 +- t/release/p-1.0.20.t | 2 +- t/release/packages-unclaimable.t | 5 ++- t/release/packages.t | 3 +- t/release/perl-changes-file.t | 2 +- t/release/pm-PL.t | 2 +- t/release/pod-examples.t | 1 - t/release/pod-pm.t | 2 +- t/release/prefer-meta-json.t | 2 +- t/release/scripts.t | 2 +- t/release/some-trial.t | 2 +- t/release/versions.t | 2 +- t/script/load.t | 2 ++ t/script/mapping.t | 4 +-- t/script/queue.t | 4 +-- t/script/river.t | 2 +- t/script/runner.t | 2 +- t/server/controller/author.t | 4 +-- t/server/controller/bad_request.t | 2 +- t/server/controller/changes.t | 4 +-- t/server/controller/contributor.t | 6 ++-- t/server/controller/cover.t | 2 +- t/server/controller/diff.t | 4 +-- t/server/controller/distribution.t | 4 +-- t/server/controller/file.t | 4 +-- t/server/controller/login/pause.t | 6 ++-- t/server/controller/mirror.t | 4 +-- t/server/controller/module.t | 4 +-- t/server/controller/package.t | 6 ++-- t/server/controller/permission.t | 6 ++-- t/server/controller/rating.t | 5 ++- t/server/controller/release.t | 4 +-- t/server/controller/root.t | 2 +- t/server/controller/scroll.t | 4 +-- t/server/controller/search/autocomplete.t | 4 +-- t/server/controller/source.t | 6 ++-- t/server/controller/url_parameters.pm | 4 +-- t/server/controller/user/favorite.t | 4 +-- t/server/controller/user/turing.t | 4 +-- t/server/not_found.t | 4 +-- t/server/sanitize_query.t | 4 +-- t/util.t | 2 +- 68 files changed, 132 insertions(+), 145 deletions(-) diff --git a/t/00_setup.t b/t/00_setup.t index c9ba3134b..982dbeb11 100644 --- a/t/00_setup.t +++ b/t/00_setup.t @@ -5,8 +5,7 @@ use lib 't/lib'; use CPAN::Faker 0.010 (); use Devel::Confess; use MetaCPAN::Script::Tickets (); -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( +use MetaCPAN::TestHelpers qw( fakecpan_configs_dir fakecpan_dir get_config @@ -14,7 +13,6 @@ use MetaCPAN::TestHelpers qw( write_find_ls ); use MetaCPAN::TestServer (); -use Module::Faker 0.015 (); # Generates META.json. use Test::More 0.96; use URI::FromHash qw( uri ); diff --git a/t/01_darkpan.t b/t/01_darkpan.t index 78b6106ad..5b5b8de4e 100644 --- a/t/01_darkpan.t +++ b/t/01_darkpan.t @@ -3,9 +3,9 @@ use warnings; use lib 't/lib'; use Devel::Confess; -use MetaCPAN::DarkPAN (); -use MetaCPAN::TestServer; -use MetaCPAN::Tests::Controller::Search::DownloadURL; +use MetaCPAN::DarkPAN (); +use MetaCPAN::TestServer (); +use MetaCPAN::Tests::Controller::Search::DownloadURL (); use Test::More; use Test::RequiresInternet ( 'cpan.metacpan.org' => 80 ); diff --git a/t/api/controller/cover.t b/t/api/controller/cover.t index d04821a4c..270aee615 100644 --- a/t/api/controller/cover.t +++ b/t/api/controller/cover.t @@ -2,8 +2,7 @@ use Mojo::Base -strict; use lib 't/lib'; -use MetaCPAN::Model::Search (); -use MetaCPAN::TestServer (); +use MetaCPAN::TestServer (); use Test::More; use Test::Mojo (); diff --git a/t/lib/MetaCPAN/DarkPAN.pm b/t/lib/MetaCPAN/DarkPAN.pm index 5382c89dc..5a6b77824 100644 --- a/t/lib/MetaCPAN/DarkPAN.pm +++ b/t/lib/MetaCPAN/DarkPAN.pm @@ -2,14 +2,13 @@ package MetaCPAN::DarkPAN; use MetaCPAN::Moose; -use CPAN::Repository::Perms; -use MetaCPAN::TestHelpers qw( get_config write_find_ls ); +use CPAN::Repository::Perms (); +use MetaCPAN::TestHelpers qw( write_find_ls ); use MetaCPAN::Types::TypeTiny qw( Path ); use MetaCPAN::Util qw( author_dir ); -use OrePAN2::Indexer; -use OrePAN2::Injector; -use Path::Tiny qw( path ); -use URI::FromHash qw( uri_object ); +use OrePAN2::Indexer (); +use OrePAN2::Injector (); +use URI::FromHash qw( uri_object ); has base_dir => ( is => 'ro', diff --git a/t/lib/MetaCPAN/Server/Test.pm b/t/lib/MetaCPAN/Server/Test.pm index ac68af2fd..4ba5fb882 100644 --- a/t/lib/MetaCPAN/Server/Test.pm +++ b/t/lib/MetaCPAN/Server/Test.pm @@ -3,9 +3,9 @@ package MetaCPAN::Server::Test; use strict; use warnings; -use HTTP::Request::Common qw(POST GET DELETE); +use HTTP::Request::Common qw( DELETE GET POST ); use MetaCPAN::Server (); -use Plack::Test; +use Plack::Test qw( test_psgi ); use Test::More; use base 'Exporter'; @@ -37,7 +37,7 @@ sub app { return $app; } -require MetaCPAN::Model; +use MetaCPAN::Model (); sub model { MetaCPAN::Model->new( es => ( $ENV{ES_TEST} ||= 'localhost:9200' ) ); diff --git a/t/lib/MetaCPAN/TestHelpers.pm b/t/lib/MetaCPAN/TestHelpers.pm index c4ec252f1..91baed991 100644 --- a/t/lib/MetaCPAN/TestHelpers.pm +++ b/t/lib/MetaCPAN/TestHelpers.pm @@ -4,16 +4,16 @@ use warnings; package # no_index MetaCPAN::TestHelpers; -use Cpanel::JSON::XS; -use File::Copy qw( copy ); -use File::pushd qw( pushd ); -use FindBin; -use MetaCPAN::Util qw( checkout_root ); -use MetaCPAN::Script::Runner; -use Path::Tiny qw( path ); +use Cpanel::JSON::XS qw( decode_json encode_json ); +use File::Copy qw( copy ); +use File::pushd qw( pushd ); +use FindBin (); +use MetaCPAN::Util qw( checkout_root ); +use MetaCPAN::Script::Runner (); +use Path::Tiny qw( path ); use Test::More; -use Test::Routine::Util; -use Try::Tiny qw( catch try ); +use Test::Routine::Util qw( run_tests ); +use Try::Tiny qw( catch finally try ); use base 'Exporter'; our @EXPORT = qw( diff --git a/t/lib/MetaCPAN/TestServer.pm b/t/lib/MetaCPAN/TestServer.pm index f60bc79a3..cc8a4f801 100644 --- a/t/lib/MetaCPAN/TestServer.pm +++ b/t/lib/MetaCPAN/TestServer.pm @@ -2,24 +2,23 @@ package MetaCPAN::TestServer; use MetaCPAN::Moose; -use MetaCPAN::DarkPAN (); -use MetaCPAN::Script::Author (); -use MetaCPAN::Script::Cover (); -use MetaCPAN::Script::CPANTestersAPI (); -use MetaCPAN::Script::Favorite (); -use MetaCPAN::Script::First (); -use MetaCPAN::Script::Latest (); -use MetaCPAN::Script::Mapping (); -use MetaCPAN::Script::Mapping::Cover (); -use MetaCPAN::Script::Mirrors (); -use MetaCPAN::Script::Package (); -use MetaCPAN::Script::Permission (); -use MetaCPAN::Script::Release (); -use MetaCPAN::Server (); -use MetaCPAN::TestHelpers qw( fakecpan_dir ); -use MetaCPAN::Types::TypeTiny qw( Path HashRef Str ); -use Search::Elasticsearch; -use Search::Elasticsearch::TestServer; +use MetaCPAN::Script::Author (); +use MetaCPAN::Script::Cover (); +use MetaCPAN::Script::CPANTestersAPI (); +use MetaCPAN::Script::Favorite (); +use MetaCPAN::Script::First (); +use MetaCPAN::Script::Latest (); +use MetaCPAN::Script::Mapping (); +use MetaCPAN::Script::Mapping::Cover (); +use MetaCPAN::Script::Mirrors (); +use MetaCPAN::Script::Package (); +use MetaCPAN::Script::Permission (); +use MetaCPAN::Script::Release (); +use MetaCPAN::Server (); +use MetaCPAN::TestHelpers qw( fakecpan_dir ); +use MetaCPAN::Types::TypeTiny qw( HashRef Path Str ); +use Search::Elasticsearch (); +use Search::Elasticsearch::TestServer (); use Test::More; use Try::Tiny qw( catch try ); diff --git a/t/lib/MetaCPAN/Tests/Controller/Search/DownloadURL.pm b/t/lib/MetaCPAN/Tests/Controller/Search/DownloadURL.pm index c3dbb94e9..d4655edf1 100644 --- a/t/lib/MetaCPAN/Tests/Controller/Search/DownloadURL.pm +++ b/t/lib/MetaCPAN/Tests/Controller/Search/DownloadURL.pm @@ -3,8 +3,8 @@ package MetaCPAN::Tests::Controller::Search::DownloadURL; use strict; use warnings; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers; +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok ); use Moose; use Test::More; diff --git a/t/lib/MetaCPAN/Tests/Model.pm b/t/lib/MetaCPAN/Tests/Model.pm index 8dafdd394..86a384c79 100644 --- a/t/lib/MetaCPAN/Tests/Model.pm +++ b/t/lib/MetaCPAN/Tests/Model.pm @@ -5,7 +5,7 @@ use Test::Routine; use MetaCPAN::Server::Test (); use MetaCPAN::Types::TypeTiny qw( ArrayRef HashRef Str ); use Test::More; -use Try::Tiny qw( catch try ); +use Try::Tiny qw( try ); with qw( MetaCPAN::Tests::Extra diff --git a/t/lib/MetaCPAN/Tests/Release.pm b/t/lib/MetaCPAN/Tests/Release.pm index d5ed01e99..96f9dad04 100644 --- a/t/lib/MetaCPAN/Tests/Release.pm +++ b/t/lib/MetaCPAN/Tests/Release.pm @@ -4,8 +4,8 @@ use Test::Routine; use version; -use HTTP::Request::Common; -use List::Util (); +use HTTP::Request::Common qw( GET ); +use List::Util (); use Test::More; use MetaCPAN::Types::TypeTiny qw( ArrayRef HashRef Str ); diff --git a/t/lib/MetaCPAN/Tests/UserAgent.pm b/t/lib/MetaCPAN/Tests/UserAgent.pm index 8ee546122..d5a0a1cbe 100644 --- a/t/lib/MetaCPAN/Tests/UserAgent.pm +++ b/t/lib/MetaCPAN/Tests/UserAgent.pm @@ -6,9 +6,9 @@ package MetaCPAN::Tests::UserAgent; use Test::Routine; use Test::More; -use LWP::UserAgent; -use HTTP::Cookies; -use HTTP::Request; +use LWP::UserAgent (); +use HTTP::Cookies (); +use HTTP::Request (); has cb => ( is => 'ro', diff --git a/t/lib/Module/Faker/Dist/WithPerl.pm b/t/lib/Module/Faker/Dist/WithPerl.pm index 8366b5de1..eaecc2e0c 100644 --- a/t/lib/Module/Faker/Dist/WithPerl.pm +++ b/t/lib/Module/Faker/Dist/WithPerl.pm @@ -4,7 +4,7 @@ package # no_index use Moose; extends 'Module::Faker::Dist'; -use Encode; +use Encode qw( encode_utf8 ); around append_for => sub { my ( $orig, $self, $filename ) = @_; diff --git a/t/model/archive.t b/t/model/archive.t index 4cb14a6a3..d9d91ab03 100644 --- a/t/model/archive.t +++ b/t/model/archive.t @@ -5,8 +5,8 @@ use lib 't/lib'; use Digest::SHA qw( sha1_hex ); use MetaCPAN::TestHelpers qw( fakecpan_dir ); use Test::More; -use Test::Fatal; -use Test::Deep qw(cmp_bag); +use Test::Fatal qw( exception ); +use Test::Deep qw( cmp_bag ); my $CLASS = 'MetaCPAN::Model::Archive'; require_ok $CLASS; diff --git a/t/model/release.t b/t/model/release.t index ee8f1923a..6ef374815 100644 --- a/t/model/release.t +++ b/t/model/release.t @@ -5,8 +5,7 @@ use lib 't/lib'; use File::Temp (); use LWP::Simple qw( getstore ); use MetaCPAN::Model::Release (); -use MetaCPAN::Script::Runner; -use MetaCPAN::TestHelpers qw( get_config ); +use MetaCPAN::TestHelpers qw( get_config ); use Test::More; use Test::RequiresInternet( 'metacpan.org' => 'https' ); diff --git a/t/model/release/dependencies.t b/t/model/release/dependencies.t index ae47852bf..d08dd8a6f 100644 --- a/t/model/release/dependencies.t +++ b/t/model/release/dependencies.t @@ -3,10 +3,9 @@ use warnings; use lib 't/lib'; use MetaCPAN::Model::Release (); -use MetaCPAN::Script::Runner; -use MetaCPAN::TestHelpers qw( fakecpan_dir get_config ); +use MetaCPAN::TestHelpers qw( fakecpan_dir get_config ); use Test::More; -use Test::Deep qw(cmp_bag); +use Test::Deep qw( cmp_bag ); my $config = get_config(); diff --git a/t/model/release/reverse_dependencies.t b/t/model/release/reverse_dependencies.t index ffcd118ad..3b2f60e16 100644 --- a/t/model/release/reverse_dependencies.t +++ b/t/model/release/reverse_dependencies.t @@ -3,9 +3,10 @@ use warnings; use lib 't/lib'; use MetaCPAN::Server (); + use Test::More; -my $c = 'MetaCPAN::Server'; +my $c = MetaCPAN::Server::; subtest 'distribution reverse_dependencies' => sub { my $data = [ diff --git a/t/package.t b/t/package.t index dc43e020f..07e9536ce 100644 --- a/t/package.t +++ b/t/package.t @@ -3,7 +3,7 @@ use warnings; use lib 't/lib'; use Test::More; -use MetaCPAN::Script::Runner; +use MetaCPAN::Script::Runner (); local @ARGV = ('package'); diff --git a/t/permission.t b/t/permission.t index ca6c9d9d2..350de1211 100644 --- a/t/permission.t +++ b/t/permission.t @@ -3,7 +3,7 @@ use warnings; use lib 't/lib'; use Test::More; -use MetaCPAN::Script::Runner; +use MetaCPAN::Script::Runner (); local @ARGV = ('permission'); diff --git a/t/release/bugs.t b/t/release/bugs.t index 5b1a724b1..a0e443e90 100644 --- a/t/release/bugs.t +++ b/t/release/bugs.t @@ -2,7 +2,6 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; use MetaCPAN::TestHelpers qw( test_distribution ); use Test::More; diff --git a/t/release/documentation-hide.t b/t/release/documentation-hide.t index 6f1a39a39..58cd0fd56 100644 --- a/t/release/documentation-hide.t +++ b/t/release/documentation-hide.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; +use MetaCPAN::Server::Test qw( model ); use Test::More; my $model = model(); diff --git a/t/release/documentation-not-readme.t b/t/release/documentation-not-readme.t index 5ce7d39a7..e6554aa60 100644 --- a/t/release/documentation-not-readme.t +++ b/t/release/documentation-not-readme.t @@ -2,7 +2,6 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; use MetaCPAN::TestHelpers qw( test_release ); use Test::More; diff --git a/t/release/file-changes.t b/t/release/file-changes.t index bf55b71eb..2eeda79ec 100644 --- a/t/release/file-changes.t +++ b/t/release/file-changes.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; +use MetaCPAN::Server::Test qw( model ); use Test::More; my $model = model(); diff --git a/t/release/file-duplicates.t b/t/release/file-duplicates.t index 01e53cfaa..f9d2c72ad 100644 --- a/t/release/file-duplicates.t +++ b/t/release/file-duplicates.t @@ -2,8 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use Cpanel::JSON::XS (); -use MetaCPAN::Server::Test; +use Cpanel::JSON::XS (); use MetaCPAN::TestHelpers qw( test_release ); use Test::More; diff --git a/t/release/meta-license.t b/t/release/meta-license.t index 63010f78a..dee378bba 100644 --- a/t/release/meta-license.t +++ b/t/release/meta-license.t @@ -2,7 +2,6 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; use MetaCPAN::TestHelpers qw( test_release ); use Test::More; diff --git a/t/release/meta-provides.t b/t/release/meta-provides.t index fc7fff980..5536a0ccf 100644 --- a/t/release/meta-provides.t +++ b/t/release/meta-provides.t @@ -2,7 +2,6 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; use MetaCPAN::TestHelpers qw( test_release ); use Test::More; diff --git a/t/release/moose.t b/t/release/moose.t index 0e8f77184..88ea6aa66 100644 --- a/t/release/moose.t +++ b/t/release/moose.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; +use MetaCPAN::Server::Test qw( model ); use Test::More; my $model = model(); diff --git a/t/release/multiple-modules.t b/t/release/multiple-modules.t index 7afd61a61..ede71c347 100644 --- a/t/release/multiple-modules.t +++ b/t/release/multiple-modules.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; +use MetaCPAN::Server::Test qw( model ); use Test::More; my $model = model(); diff --git a/t/release/p-1.0.20.t b/t/release/p-1.0.20.t index 37d87ee0f..4ce416ce3 100644 --- a/t/release/p-1.0.20.t +++ b/t/release/p-1.0.20.t @@ -6,7 +6,7 @@ use MetaCPAN::TestHelpers qw( test_release ); use Ref::Util qw( is_hashref ); use Test::More; -use MetaCPAN::TestServer; +use MetaCPAN::TestServer (); my $server = MetaCPAN::TestServer->new; $server->index_cpantesters; diff --git a/t/release/packages-unclaimable.t b/t/release/packages-unclaimable.t index 23a6d5ad9..245a1fec4 100644 --- a/t/release/packages-unclaimable.t +++ b/t/release/packages-unclaimable.t @@ -2,9 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use Cpanel::JSON::XS (); -use List::Util qw( uniq ); -use MetaCPAN::Server::Test; +use Cpanel::JSON::XS (); +use List::Util qw( uniq ); use MetaCPAN::TestHelpers qw( test_release ); use Module::Metadata (); use Test::More; diff --git a/t/release/packages.t b/t/release/packages.t index f326d9c26..0f2935aab 100644 --- a/t/release/packages.t +++ b/t/release/packages.t @@ -2,8 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use Cpanel::JSON::XS (); -use MetaCPAN::Server::Test; +use Cpanel::JSON::XS (); use MetaCPAN::TestHelpers qw( test_release ); use Test::More; diff --git a/t/release/perl-changes-file.t b/t/release/perl-changes-file.t index 310478b6b..5fc8f5530 100644 --- a/t/release/perl-changes-file.t +++ b/t/release/perl-changes-file.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; +use MetaCPAN::Server::Test qw( model ); use Test::More; my $model = model(); diff --git a/t/release/pm-PL.t b/t/release/pm-PL.t index bd51e64f1..293126d23 100644 --- a/t/release/pm-PL.t +++ b/t/release/pm-PL.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; +use MetaCPAN::Server::Test qw( app GET model test_psgi ); use Test::More; my $model = model(); diff --git a/t/release/pod-examples.t b/t/release/pod-examples.t index e79b108f8..6e781857e 100644 --- a/t/release/pod-examples.t +++ b/t/release/pod-examples.t @@ -2,7 +2,6 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; use MetaCPAN::TestHelpers qw( test_release ); use Test::More; diff --git a/t/release/pod-pm.t b/t/release/pod-pm.t index 872cc8a44..3aab2e03d 100644 --- a/t/release/pod-pm.t +++ b/t/release/pod-pm.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; +use MetaCPAN::Server::Test qw( model ); use Test::More; my $model = model(); diff --git a/t/release/prefer-meta-json.t b/t/release/prefer-meta-json.t index 5efc6e055..f89959c04 100644 --- a/t/release/prefer-meta-json.t +++ b/t/release/prefer-meta-json.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; +use MetaCPAN::Server::Test qw( model ); use Test::More; my $model = model(); diff --git a/t/release/scripts.t b/t/release/scripts.t index 1b9d89be6..e7490e4ab 100644 --- a/t/release/scripts.t +++ b/t/release/scripts.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; +use MetaCPAN::Server::Test qw( model ); use Test::More skip_all => 'Scripting is disabled'; my $model = model(); diff --git a/t/release/some-trial.t b/t/release/some-trial.t index f9d4e1c58..623c8ff07 100644 --- a/t/release/some-trial.t +++ b/t/release/some-trial.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; +use MetaCPAN::Server::Test qw( model ); use Test::More; my $model = model(); diff --git a/t/release/versions.t b/t/release/versions.t index 447587ed5..3ebf0ff5c 100644 --- a/t/release/versions.t +++ b/t/release/versions.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; +use MetaCPAN::Server::Test qw( model ); use Test::More; my $model = model(); diff --git a/t/script/load.t b/t/script/load.t index 5ffd04e32..6d43d8c3e 100644 --- a/t/script/load.t +++ b/t/script/load.t @@ -4,6 +4,7 @@ use lib 't/lib'; use Test::More; +## no perlimports use MetaCPAN::Script::Author (); use MetaCPAN::Script::Backpan (); use MetaCPAN::Script::Backup (); @@ -49,6 +50,7 @@ use MetaCPAN::Script::Snapshot (); use MetaCPAN::Script::Suggest (); use MetaCPAN::Script::Tickets (); use MetaCPAN::Script::Watcher (); +## use perlimports pass 'all loaded Ok'; diff --git a/t/script/mapping.t b/t/script/mapping.t index fb234936e..1beb52c94 100644 --- a/t/script/mapping.t +++ b/t/script/mapping.t @@ -4,8 +4,8 @@ use lib 't/lib'; use Test::More; -use MetaCPAN::Script::Runner qw(build_config); -use MetaCPAN::Script::Mapping; +use MetaCPAN::Script::Runner (); +use MetaCPAN::Script::Mapping (); my $config = MetaCPAN::Script::Runner::build_config; diff --git a/t/script/queue.t b/t/script/queue.t index 40007c81e..81161a54f 100644 --- a/t/script/queue.t +++ b/t/script/queue.t @@ -4,8 +4,8 @@ use lib 't/lib'; use Test::More; -use MetaCPAN::Script::Runner; -use MetaCPAN::Script::Queue (); +use MetaCPAN::Script::Runner (); +use MetaCPAN::Script::Queue (); my $config = MetaCPAN::Script::Runner::build_config; local @ARGV = ( '--dir', $config->{cpan} ); diff --git a/t/script/river.t b/t/script/river.t index faf8d7c46..b425b523d 100644 --- a/t/script/river.t +++ b/t/script/river.t @@ -5,7 +5,7 @@ use lib 't/lib'; use MetaCPAN::Util qw( checkout_root ); use MetaCPAN::Script::River (); use MetaCPAN::Script::Runner (); -use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::Server::Test qw( app GET ); use MetaCPAN::TestHelpers qw( decode_json_ok ); use Test::More; use URI (); diff --git a/t/script/runner.t b/t/script/runner.t index ada166a45..b365eea17 100644 --- a/t/script/runner.t +++ b/t/script/runner.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Script::Runner; +use MetaCPAN::Script::Runner (); use Module::Pluggable search_dirs => ['t/lib']; use Test::More; diff --git a/t/server/controller/author.t b/t/server/controller/author.t index 54048c4c6..9006bb76e 100644 --- a/t/server/controller/author.t +++ b/t/server/controller/author.t @@ -2,8 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok encode_json test_cache_headers ); +use MetaCPAN::Server::Test qw( app GET POST test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); use Test::More; my %tests = ( diff --git a/t/server/controller/bad_request.t b/t/server/controller/bad_request.t index 4e6e9c82d..d785731f1 100644 --- a/t/server/controller/bad_request.t +++ b/t/server/controller/bad_request.t @@ -4,7 +4,7 @@ use lib 't/lib'; use Cpanel::JSON::XS qw( decode_json ); use MetaCPAN::Server (); -use Plack::Test qw(); +use Plack::Test (); use Test::More; use Ref::Util qw( is_hashref ); diff --git a/t/server/controller/changes.t b/t/server/controller/changes.t index 57ccfc652..a0a82d6fc 100644 --- a/t/server/controller/changes.t +++ b/t/server/controller/changes.t @@ -2,8 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); use Test::More; my $LOCAL_default_headers = { diff --git a/t/server/controller/contributor.t b/t/server/controller/contributor.t index 7cef8afff..1afa1cc54 100644 --- a/t/server/controller/contributor.t +++ b/t/server/controller/contributor.t @@ -2,9 +2,9 @@ use strict; use warnings; use lib 't/lib'; -use Cpanel::JSON::XS qw( decode_json ); -use MetaCPAN::Server::Test; -use MetaCPAN::TestServer; +use Cpanel::JSON::XS qw( decode_json ); +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestServer (); use Test::More; my $server = MetaCPAN::TestServer->new; diff --git a/t/server/controller/cover.t b/t/server/controller/cover.t index b309ec037..704f8d68b 100644 --- a/t/server/controller/cover.t +++ b/t/server/controller/cover.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::Server::Test qw( app GET ); use MetaCPAN::TestHelpers qw( decode_json_ok ); use Test::More; diff --git a/t/server/controller/diff.t b/t/server/controller/diff.t index 926d8ed8d..e8d8e6a67 100644 --- a/t/server/controller/diff.t +++ b/t/server/controller/diff.t @@ -2,8 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok multiline_diag test_cache_headers diff --git a/t/server/controller/distribution.t b/t/server/controller/distribution.t index 101ee30f9..2c8c300b2 100644 --- a/t/server/controller/distribution.t +++ b/t/server/controller/distribution.t @@ -2,8 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); use Test::More; my @tests = ( diff --git a/t/server/controller/file.t b/t/server/controller/file.t index c1a92dbec..115ccffcb 100644 --- a/t/server/controller/file.t +++ b/t/server/controller/file.t @@ -2,8 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); use Test::More; my %tests = ( diff --git a/t/server/controller/login/pause.t b/t/server/controller/login/pause.t index 608859499..b83a42e38 100644 --- a/t/server/controller/login/pause.t +++ b/t/server/controller/login/pause.t @@ -3,9 +3,9 @@ use warnings; use lib 't/lib'; use utf8; -use Encode qw( encode FB_CROAK is_utf8 LEAVE_SRC ); -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok ); +use Encode qw( encode FB_CROAK is_utf8 LEAVE_SRC ); +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok ); use Test::More; BEGIN { $ENV{EMAIL_SENDER_TRANSPORT} = 'Test' } diff --git a/t/server/controller/mirror.t b/t/server/controller/mirror.t index 3f2263905..39c33b6e1 100644 --- a/t/server/controller/mirror.t +++ b/t/server/controller/mirror.t @@ -2,8 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); use Test::More; my %tests = ( diff --git a/t/server/controller/module.t b/t/server/controller/module.t index 08d235166..5f8b83c43 100644 --- a/t/server/controller/module.t +++ b/t/server/controller/module.t @@ -2,8 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); use Test::More; my %tests = ( diff --git a/t/server/controller/package.t b/t/server/controller/package.t index 9257df476..a36163c01 100644 --- a/t/server/controller/package.t +++ b/t/server/controller/package.t @@ -2,9 +2,9 @@ use strict; use warnings; use lib 't/lib'; -use Cpanel::JSON::XS qw( decode_json ); -use MetaCPAN::Server::Test; -use MetaCPAN::TestServer; +use Cpanel::JSON::XS qw( decode_json ); +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestServer (); use Test::More; my $server = MetaCPAN::TestServer->new; diff --git a/t/server/controller/permission.t b/t/server/controller/permission.t index f272bb570..9ac89b5ac 100644 --- a/t/server/controller/permission.t +++ b/t/server/controller/permission.t @@ -2,9 +2,9 @@ use strict; use warnings; use lib 't/lib'; -use Cpanel::JSON::XS qw( decode_json ); -use MetaCPAN::Server::Test; -use MetaCPAN::TestServer; +use Cpanel::JSON::XS qw( decode_json ); +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestServer (); use Test::More; my $server = MetaCPAN::TestServer->new; diff --git a/t/server/controller/rating.t b/t/server/controller/rating.t index f46543925..e59adb3c2 100644 --- a/t/server/controller/rating.t +++ b/t/server/controller/rating.t @@ -2,9 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); -use Cpanel::JSON::XS qw(encode_json); +use MetaCPAN::Server::Test qw( app GET POST test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok ); use Test::More; test_psgi app, sub { diff --git a/t/server/controller/release.t b/t/server/controller/release.t index 73d7e574e..340382e46 100644 --- a/t/server/controller/release.t +++ b/t/server/controller/release.t @@ -2,8 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); use Test::More; { diff --git a/t/server/controller/root.t b/t/server/controller/root.t index 0b5f71831..5039474a5 100644 --- a/t/server/controller/root.t +++ b/t/server/controller/root.t @@ -2,7 +2,7 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test qw( app GET test_psgi); +use MetaCPAN::Server::Test qw( app GET test_psgi ); use Test::More; test_psgi app, sub { diff --git a/t/server/controller/scroll.t b/t/server/controller/scroll.t index f044f9578..e9ba29ce1 100644 --- a/t/server/controller/scroll.t +++ b/t/server/controller/scroll.t @@ -2,8 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); +use MetaCPAN::Server::Test qw( app GET POST test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok test_cache_headers ); use Test::More; test_psgi app, sub { diff --git a/t/server/controller/search/autocomplete.t b/t/server/controller/search/autocomplete.t index dcdce2d6f..4facdb103 100644 --- a/t/server/controller/search/autocomplete.t +++ b/t/server/controller/search/autocomplete.t @@ -2,8 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok ); +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok ); use Test::More; test_psgi app, sub { diff --git a/t/server/controller/source.t b/t/server/controller/source.t index 46bd90ea4..d14ffb875 100644 --- a/t/server/controller/source.t +++ b/t/server/controller/source.t @@ -2,9 +2,9 @@ use strict; use warnings; use lib 't/lib'; -use Cpanel::JSON::XS (); -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( test_cache_headers ); +use Cpanel::JSON::XS (); +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestHelpers qw( test_cache_headers ); use Test::More; my %tests = ( diff --git a/t/server/controller/url_parameters.pm b/t/server/controller/url_parameters.pm index 40a9ac74f..5472cc24c 100644 --- a/t/server/controller/url_parameters.pm +++ b/t/server/controller/url_parameters.pm @@ -4,8 +4,8 @@ use warnings; use Cpanel::JSON::XS (); use HTTP::Request::Common qw( GET ); use MetaCPAN::Server (); -use MetaCPAN::TestHelpers; -use Plack::Test; +use MetaCPAN::TestHelpers qw( test_cache_headers ); +use Plack::Test (); use Test::More; use Ref::Util qw( is_arrayref is_hashref ); diff --git a/t/server/controller/user/favorite.t b/t/server/controller/user/favorite.t index 24448e476..3e4f06727 100644 --- a/t/server/controller/user/favorite.t +++ b/t/server/controller/user/favorite.t @@ -2,8 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok encode_json ); +use MetaCPAN::Server::Test qw( app DELETE GET POST test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok encode_json ); use Test::More; test_psgi app, sub { diff --git a/t/server/controller/user/turing.t b/t/server/controller/user/turing.t index 6804bd468..d62602900 100644 --- a/t/server/controller/user/turing.t +++ b/t/server/controller/user/turing.t @@ -15,8 +15,8 @@ use lib 't/lib'; } } -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok encode_json ); +use MetaCPAN::Server::Test qw( app POST test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok encode_json ); use Test::More; test_psgi app, sub { diff --git a/t/server/not_found.t b/t/server/not_found.t index 61f3d2849..cf9baa049 100644 --- a/t/server/not_found.t +++ b/t/server/not_found.t @@ -2,8 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok ); +use MetaCPAN::Server::Test qw( app GET test_psgi ); +use MetaCPAN::TestHelpers qw( decode_json_ok ); use Test::More; my @tests = ( diff --git a/t/server/sanitize_query.t b/t/server/sanitize_query.t index 21c230527..d843eeb33 100644 --- a/t/server/sanitize_query.t +++ b/t/server/sanitize_query.t @@ -2,8 +2,8 @@ use strict; use warnings; use lib 't/lib'; -use MetaCPAN::Server::Test; -use MetaCPAN::TestHelpers qw( decode_json_ok encode_json ); +use MetaCPAN::Server::Test qw( app GET POST test_psgi ); +use MetaCPAN::TestHelpers qw( catch decode_json_ok encode_json try ); use Test::More skip_all => 'Scripting is disabled'; use URI (); diff --git a/t/util.t b/t/util.t index c48636d5f..bf07626de 100644 --- a/t/util.t +++ b/t/util.t @@ -11,7 +11,7 @@ use MetaCPAN::Util qw( ); use Test::More; -use Test::Fatal; +use Test::Fatal qw( exception ); ok( generate_sid(), 'generate_sid' );